diff options
Diffstat (limited to 'shell/hush_test')
-rw-r--r-- | shell/hush_test/hush-misc/continue2.right | 1 | ||||
-rw-r--r-- | shell/hush_test/hush-misc/continue2.tests | 3 | ||||
-rw-r--r-- | shell/hush_test/hush-misc/continue3.right | 2 | ||||
-rw-r--r-- | shell/hush_test/hush-misc/continue3.tests | 3 | ||||
-rw-r--r-- | shell/hush_test/hush-misc/until1.right | 3 | ||||
-rw-r--r-- | shell/hush_test/hush-misc/until1.tests | 11 | ||||
-rw-r--r-- | shell/hush_test/hush-misc/while2.right | 2 | ||||
-rw-r--r-- | shell/hush_test/hush-misc/while2.tests | 2 | ||||
-rwxr-xr-x | shell/hush_test/run-all | 2 |
9 files changed, 28 insertions, 1 deletions
diff --git a/shell/hush_test/hush-misc/continue2.right b/shell/hush_test/hush-misc/continue2.right new file mode 100644 index 0000000..49d3ebd --- /dev/null +++ b/shell/hush_test/hush-misc/continue2.right @@ -0,0 +1 @@ +Ok:1 diff --git a/shell/hush_test/hush-misc/continue2.tests b/shell/hush_test/hush-misc/continue2.tests new file mode 100644 index 0000000..c2df071 --- /dev/null +++ b/shell/hush_test/hush-misc/continue2.tests @@ -0,0 +1,3 @@ +e='' +(while test $e && exit 1; true; do e=1; continue; done) +echo Ok:$? diff --git a/shell/hush_test/hush-misc/continue3.right b/shell/hush_test/hush-misc/continue3.right new file mode 100644 index 0000000..aa47d0d --- /dev/null +++ b/shell/hush_test/hush-misc/continue3.right @@ -0,0 +1,2 @@ +0 +0 diff --git a/shell/hush_test/hush-misc/continue3.tests b/shell/hush_test/hush-misc/continue3.tests new file mode 100644 index 0000000..0aff867 --- /dev/null +++ b/shell/hush_test/hush-misc/continue3.tests @@ -0,0 +1,3 @@ +# Test that "continue" does affect exitcode (sets to 0) +e='' +while echo $?; test $e && exit; true; do e=1; false; continue; done diff --git a/shell/hush_test/hush-misc/until1.right b/shell/hush_test/hush-misc/until1.right new file mode 100644 index 0000000..be2daad --- /dev/null +++ b/shell/hush_test/hush-misc/until1.right @@ -0,0 +1,3 @@ +1 +1 +Ok:0 diff --git a/shell/hush_test/hush-misc/until1.tests b/shell/hush_test/hush-misc/until1.tests new file mode 100644 index 0000000..10ab283 --- /dev/null +++ b/shell/hush_test/hush-misc/until1.tests @@ -0,0 +1,11 @@ +x=1 +until test "$x" = 4; do echo $x; x=4; done + +# We had a bug in multi-line form +x=1 +until test "$x" = 4; do + echo $x + x=4 +done + +echo Ok:$? diff --git a/shell/hush_test/hush-misc/while2.right b/shell/hush_test/hush-misc/while2.right new file mode 100644 index 0000000..07207cc --- /dev/null +++ b/shell/hush_test/hush-misc/while2.right @@ -0,0 +1,2 @@ +Hello +OK:0 diff --git a/shell/hush_test/hush-misc/while2.tests b/shell/hush_test/hush-misc/while2.tests new file mode 100644 index 0000000..2247adc --- /dev/null +++ b/shell/hush_test/hush-misc/while2.tests @@ -0,0 +1,2 @@ +while echo Hello; false; do echo NOT SHOWN; done +echo OK:$? diff --git a/shell/hush_test/run-all b/shell/hush_test/run-all index 3fe3ba5..c7989a1 100755 --- a/shell/hush_test/run-all +++ b/shell/hush_test/run-all @@ -46,7 +46,7 @@ do_test() test -x "$x" || continue name="${x%%.tests}" test -f "$name.right" || continue -# echo Running test: "$name.right" +# echo Running test: "$x" { "$THIS_SH" "./$x" >"$name.xx" 2>&1 diff -u "$name.xx" "$name.right" >"../$1-$x.fail" && rm -f "$name.xx" "../$1-$x.fail" |