From ac12274acd289ea2c3715619bb0d03e9d0c8919e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Sat, 12 Dec 2020 05:49:06 +0100 Subject: [PATCH] cmdlineTests.sh: Fix the script failing to detect that --ast option does not exist --- test/cmdlineTests.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index 5420d5f59..2dedbafe7 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -436,15 +436,18 @@ SOLTMPDIR=$(mktemp -d) # The contract should be compiled if [[ "$result" != 0 ]] then + printError "Failed to compile a simple contract from standard input" exit 1 fi # This should not fail set +e - output=$(echo '' | "$SOLC" --ast - 2>/dev/null) + output=$(echo '' | "$SOLC" --ast-json - 2>/dev/null) + result=$? set -e - if [[ $? != 0 ]] + if [[ $result != 0 ]] then + printError "Incorrect response to --ast-json option with empty stdin" exit 1 fi )