diff options
| author | Mustafa Quraish <[email protected]> | 2022-01-29 13:52:58 -0500 |
|---|---|---|
| committer | Mustafa Quraish <[email protected]> | 2022-01-29 13:53:57 -0500 |
| commit | e403475bbf6f70b3e79b6f4503dbadcc3dad504c (patch) | |
| tree | 40c77638cf96048328358e601c541ab31fb2b23a /tests/common.sh | |
| parent | Add some tests for local variables (diff) | |
| download | cup-e403475bbf6f70b3e79b6f4503dbadcc3dad504c.tar.xz cup-e403475bbf6f70b3e79b6f4503dbadcc3dad504c.zip | |
Allow uninitialized variable declarations
Diffstat (limited to 'tests/common.sh')
| -rw-r--r-- | tests/common.sh | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/tests/common.sh b/tests/common.sh index 7c8b5ae..dd64ade 100644 --- a/tests/common.sh +++ b/tests/common.sh @@ -18,8 +18,8 @@ function assert_exit_status() { echo "" echo "----------------------------------" echo "Test failed: expected $2, got $res" - echo "- Input was:" - echo " \`$1\`" + echo "----------------------------------" + echo "$1" exit 1 fi set -e @@ -27,21 +27,6 @@ function assert_exit_status() { } function assert_exit_status_stdin() { - ./cupcc - - assemble - - set +e - ./a.out - res=$? - if [ $res -ne $1 ] - then - echo "" - echo "----------------------------------" - echo "Test failed: expected $2, got $res" - echo "- Input was:" - echo " \`$1\`" - exit 1 - fi - set -e - echo -n "." + code=$(</dev/stdin) + assert_exit_status "$code" $1 }
\ No newline at end of file |