Avoid using $? in conditions and do && exit 1 instead if !

This commit is contained in:
Kamil Śliwak
2021-03-04 16:57:25 +01:00
parent 87f9eba1cf
commit c8fc241be5
2 changed files with 8 additions and 19 deletions
+1 -2
View File
@@ -45,8 +45,7 @@ function testImportExportEquivalence {
# save exported json as expected result (silently)
$SOLC --combined-json ast,compact-format --pretty-json "$nth_input_file" "${all_input_files[@]}" > expected.json 2> /dev/null
# import it, and export it again as obtained result (silently)
$SOLC --import-ast --combined-json ast,compact-format --pretty-json expected.json > obtained.json 2> /dev/null
if [ $? -ne 0 ]
if ! $SOLC --import-ast --combined-json ast,compact-format --pretty-json expected.json > obtained.json 2> /dev/null
then
# For investigating, use exit 1 here so the script stops at the
# first failing test