From e403475bbf6f70b3e79b6f4503dbadcc3dad504c Mon Sep 17 00:00:00 2001 From: Mustafa Quraish Date: Sat, 29 Jan 2022 13:52:58 -0500 Subject: Allow uninitialized variable declarations --- tests/common.sh | 23 ++++------------------- tests/variables.sh | 30 +++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 20 deletions(-) (limited to 'tests') 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=$(