diff options
| author | bd-912 <bdunahu@colostate.edu> | 2024-04-26 20:33:19 -0600 | 
|---|---|---|
| committer | bd-912 <bdunahu@colostate.edu> | 2024-04-26 20:33:19 -0600 | 
| commit | 75b0f765acdaf6571a723b8933ad584b980d08d4 (patch) | |
| tree | 9853ed63cb4834770ea857f85706b26e37136d92 /test.sh | |
| parent | d5960ffb93b701d6dfaff412d9ed12d9bbf2338b (diff) | |
Update test file for Typecheck negative examples
Diffstat (limited to 'test.sh')
| -rwxr-xr-x | test.sh | 24 | 
1 files changed, 14 insertions, 10 deletions
@@ -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  | 
