diff options
author | ubq323 <ubq323@ubq323.website> | 2024-07-13 12:34:33 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-07-13 12:34:33 +0100 |
commit | cb738e17c9751fadc990fda75fa023a8fe9fd671 (patch) | |
tree | 599c94e8e9678e2393e81640faf46d9e660df820 /run_tests.sh | |
parent | d9d307bc676387ab8894f9fb1ee722db8ecf7272 (diff) |
add iota tests
Diffstat (limited to 'run_tests.sh')
-rwxr-xr-x | run_tests.sh | 11 |
1 files changed, 5 insertions, 6 deletions
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 } |