aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2026-05-21 18:13:15 -0400
committerSam Anthony <sam@samanthony.xyz>2026-05-21 18:21:54 -0400
commit06ba9b3e492ca47f6f966bd7bd6044809b989c30 (patch)
tree8077af89b899ca57be8d688380c36bbc70534103 /cmd
parent9d5cc798f82ff4a899984fa73014bd604d44ee32 (diff)
downloadlulu-0.1.0.zip
tidyv0.1.0
Diffstat (limited to 'cmd')
-rwxr-xr-xcmd/lulu/test17
1 files changed, 9 insertions, 8 deletions
diff --git a/cmd/lulu/test b/cmd/lulu/test
index 3aacc99..3a98d91 100755
--- a/cmd/lulu/test
+++ b/cmd/lulu/test
@@ -10,21 +10,20 @@ export money='[0-9]+(\.[0-9]+)? [A-Z]{3}'
export pkgid='[0-9]{4}X[0-9]{4}\.[A-Z]{2}\.[A-Z]{3}\.[A-Z]{2}\.[A-Z0-9]{5,8}\.[A-Z]{3}'
export time='[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z'
-
-
-[[ ! -d testout ]] && mkdir testout
-[[ ! -d testerr ]] && mkdir testerr
+[[ -d testout ]] || mkdir testout
+[[ -d testerr ]] || mkdir testerr
[[ $# -gt 0 ]] && tests="tests/$1" || tests=tests/*
for test in $tests
do
- echo $test...
+ echo $test
base=${test##*/}
want=testdata/$base
check=testchecks/$base
out=testout/$base
err=testerr/$base
- if [ -f $want ]; then # check against expected output
+ if [ -f $want ]
+ then # check against expected output
if ! sh ${flags} $test >$out 2>$err
then
echo "FAIL $test: error: $err"
@@ -36,7 +35,8 @@ do
diff $want $out
exit 1
fi
- elif [ -f $check ]; then # use script to check output
+ elif [ -f $check ]
+ then # use script to check output
if ! sh ${flags} $test >$out 2>$err
then
echo "FAIL $test: error: $err"
@@ -48,7 +48,8 @@ do
echo "FAIL $test: check failed: $check"
exit 1
fi
- elif [ -f $test ]; then # test should fail
+ elif [ -f $test ]
+ then # test should fail
if sh ${flags} $test >$out 2>$err
then
echo "FAIL $test: expected error; got \"$(cat $out)\""