vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 025238c84898e294dafef9a3919ad7f9d1614c94
parent 15e2c86370827e2f089db84a6cecfb3c8b409775
Author: Christian Hesse <mail@eworm.de>
Date:   Thu,  6 Apr 2017 10:04:13 +0200

test: fail test with error on bad return code

Close #10

Diffstat:
Msam/test.sh | 3++-
Mvis/test.sh | 3++-
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sam/test.sh b/sam/test.sh @@ -74,9 +74,10 @@ for t in $TESTS; do TESTS_RUN=$((TESTS_RUN+1)) $VIS "$IN" </dev/null 2>/dev/null + RETURN_CODE=$? printf "Running test %s with vis ... " "$t" - if [ $? -ne 0 -o ! -e "$VIS_OUT" ]; then + if [ $RETURN_CODE -ne 0 -o ! -e "$VIS_OUT" ]; then printf "ERROR\n" elif cmp -s "$REF" "$VIS_OUT"; then printf "OK\n" diff --git a/vis/test.sh b/vis/test.sh @@ -26,9 +26,10 @@ for t in $test_files; do t=${t%.in} t=${t#./} $VIS "$t".in < /dev/null 2> /dev/null + RETURN_CODE=$? printf "%-50s" "$t" - if [ -e "$t".out ]; then + if [ $RETURN_CODE -eq 0 -a -e "$t".out ]; then if cmp -s "$t".ref "$t".out 2> /dev/null; then printf "PASS\n" TESTS_OK=$((TESTS_OK + 1))