From 918a34b9e04cbf368dd7a1116d7467e6e7f8ccc9 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 28 Jul 2008 23:17:31 +0000 Subject: hush: fix "while false; ..." exitcode; add testsuites --- shell/hush_test/hush-misc/break4.right | 6 ++++++ shell/hush_test/hush-misc/break4.tests | 12 ++++++++++++ shell/hush_test/hush-misc/while1.right | 1 + shell/hush_test/hush-misc/while1.tests | 2 ++ 4 files changed, 21 insertions(+) create mode 100644 shell/hush_test/hush-misc/break4.right create mode 100755 shell/hush_test/hush-misc/break4.tests create mode 100644 shell/hush_test/hush-misc/while1.right create mode 100755 shell/hush_test/hush-misc/while1.tests (limited to 'shell/hush_test') diff --git a/shell/hush_test/hush-misc/break4.right b/shell/hush_test/hush-misc/break4.right new file mode 100644 index 000000000..6f41c141d --- /dev/null +++ b/shell/hush_test/hush-misc/break4.right @@ -0,0 +1,6 @@ +A +AA +TRUE +A +AA +OK:0 diff --git a/shell/hush_test/hush-misc/break4.tests b/shell/hush_test/hush-misc/break4.tests new file mode 100755 index 000000000..67da2889c --- /dev/null +++ b/shell/hush_test/hush-misc/break4.tests @@ -0,0 +1,12 @@ +cond=true +while $cond; do + echo A + if test "$cond" = true; then + cond='echo TRUE' + else + cond=false + fi + while true; do echo AA; continue 2; echo BB; done + echo B +done +echo OK:$? diff --git a/shell/hush_test/hush-misc/while1.right b/shell/hush_test/hush-misc/while1.right new file mode 100644 index 000000000..7c4d7beb0 --- /dev/null +++ b/shell/hush_test/hush-misc/while1.right @@ -0,0 +1 @@ +OK:0 diff --git a/shell/hush_test/hush-misc/while1.tests b/shell/hush_test/hush-misc/while1.tests new file mode 100755 index 000000000..11e201e6a --- /dev/null +++ b/shell/hush_test/hush-misc/while1.tests @@ -0,0 +1,2 @@ +while false; do echo NOT SHOWN; done +echo OK:$? -- cgit v1.2.3