From 6a2d40f239566e886ef76542a75662cee9380a0e Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 28 Jul 2008 23:07:06 +0000 Subject: hush: support "break N" and "continue N" fix non-detection of builtins and applets in "v=break; ...; $v; ..." case add testsuite entries for the above function old new delta builtin_break 12 93 +81 run_list 1948 1971 +23 builtin_continue 12 21 +9 pseudo_exec_argv 132 138 +6 builtin_exec 23 25 +2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/0 up/down: 121/0) Total: 121 bytes --- shell/hush_test/hush-misc/break1.right | 2 ++ shell/hush_test/hush-misc/break1.tests | 3 +++ shell/hush_test/hush-misc/break2.right | 3 +++ shell/hush_test/hush-misc/break2.tests | 6 ++++++ shell/hush_test/hush-misc/break3.right | 2 ++ shell/hush_test/hush-misc/break3.tests | 2 ++ 6 files changed, 18 insertions(+) create mode 100644 shell/hush_test/hush-misc/break1.right create mode 100755 shell/hush_test/hush-misc/break1.tests create mode 100644 shell/hush_test/hush-misc/break2.right create mode 100755 shell/hush_test/hush-misc/break2.tests create mode 100644 shell/hush_test/hush-misc/break3.right create mode 100755 shell/hush_test/hush-misc/break3.tests (limited to 'shell/hush_test/hush-misc') diff --git a/shell/hush_test/hush-misc/break1.right b/shell/hush_test/hush-misc/break1.right new file mode 100644 index 000000000..04a4b1757 --- /dev/null +++ b/shell/hush_test/hush-misc/break1.right @@ -0,0 +1,2 @@ +A +OK:0 diff --git a/shell/hush_test/hush-misc/break1.tests b/shell/hush_test/hush-misc/break1.tests new file mode 100755 index 000000000..912f149c1 --- /dev/null +++ b/shell/hush_test/hush-misc/break1.tests @@ -0,0 +1,3 @@ +while true; do echo A; break; echo B; done +echo OK:$? + diff --git a/shell/hush_test/hush-misc/break2.right b/shell/hush_test/hush-misc/break2.right new file mode 100644 index 000000000..8a15cb95f --- /dev/null +++ b/shell/hush_test/hush-misc/break2.right @@ -0,0 +1,3 @@ +A +AA +OK:0 diff --git a/shell/hush_test/hush-misc/break2.tests b/shell/hush_test/hush-misc/break2.tests new file mode 100755 index 000000000..7da9faf34 --- /dev/null +++ b/shell/hush_test/hush-misc/break2.tests @@ -0,0 +1,6 @@ +while true; do + echo A + while true; do echo AA; break 2; echo BB; done + echo B +done +echo OK:$? diff --git a/shell/hush_test/hush-misc/break3.right b/shell/hush_test/hush-misc/break3.right new file mode 100644 index 000000000..04a4b1757 --- /dev/null +++ b/shell/hush_test/hush-misc/break3.right @@ -0,0 +1,2 @@ +A +OK:0 diff --git a/shell/hush_test/hush-misc/break3.tests b/shell/hush_test/hush-misc/break3.tests new file mode 100755 index 000000000..d138dcac5 --- /dev/null +++ b/shell/hush_test/hush-misc/break3.tests @@ -0,0 +1,2 @@ +v=break; while true; do echo A; $v; echo B; break; echo C; done +echo OK:$? -- cgit v1.2.3