From cb738e17c9751fadc990fda75fa023a8fe9fd671 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sat, 13 Jul 2024 12:34:33 +0100 Subject: add iota tests --- run_tests.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'run_tests.sh') diff --git a/run_tests.sh b/run_tests.sh index 18885da..16201b5 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -12,9 +12,8 @@ for testfile in tests/*.bth; do printf '\033[33mSKIP\033[0m %s (no output file)\n' "$testname" skip=$((skip + 1)) else - output="$(./bth $testfile 2>&1)" - run_res=$? - echo "$output" | diff $outfile - >/dev/null + output="$(./bth "$testfile" 2>&1)" + echo "$output" | diff "$outfile" - >/dev/null diff_res=$? case $diff_res in 0) printf '\033[32m\033[1mPASS\033[0m %s\n' "$testname" @@ -22,7 +21,7 @@ for testfile in tests/*.bth; do 1) printf '\033[31m\033[1mFAIL\033[0m %s\n' "$testname" printf "\tgot output: %s\n" "$(echo "$output" | head -n4)" printf "\texpected: " - cat $outfile + cat "$outfile" fail=$((fail + 1)) ;; esac fi @@ -31,10 +30,10 @@ done echo pnum () { - if [ $1 -eq 0 ]; then + if [ "$1" -eq 0 ]; then printf "0 %s; " "$2" else - printf "\033[3%dm%d\033[0m %s; " $3 $1 "$2" + printf "\033[3%dm%d\033[0m %s; " "$3" "$1" "$2" fi } -- cgit v1.2.3