From 75b0f765acdaf6571a723b8933ad584b980d08d4 Mon Sep 17 00:00:00 2001 From: bd-912 Date: Fri, 26 Apr 2024 20:33:19 -0600 Subject: Update test file for Typecheck negative examples --- test.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'test.sh') diff --git a/test.sh b/test.sh index a27b321..1f8f11e 100755 --- a/test.sh +++ b/test.sh @@ -14,11 +14,13 @@ function match() { expected="Program type checked successfully" } -testdir="./output" +dir1="./output" +dir2="" case "$1" in "heat") ext="java" comp="match" + dir2="./output/negative" ;; "boil") ext="java" @@ -38,13 +40,15 @@ case "$1" in ;; esac -echo "$testdir/*.$ext" - -for file in $testdir/*.$ext; do - [ -f "$file" ] || break - base=${file%.*} - echo -n "Processing file: $base " - $comp $base - actual=$(bash runner.sh $1 $file 2>/dev/null) - [[ $expected == $actual ]] && echo 'PASSED' || echo -e "FAILED" +for dir in "$dir1" "$dir2"; do + if [ -n "$dir" ] && [ -d "$dir" ]; then + for file in $dir/*.$ext; do + [ -f "$file" ] || break + base=${file%.*} + echo -n "Processing file: $base " + $comp $base + actual=$(bash runner.sh $1 $file 2>/dev/null) + [[ $expected == $actual ]] && echo 'PASSED' || echo -e "FAILED" + done + fi done -- cgit v1.2.3