From ff59b7b112e5dd9a69e138aa01b91d76c8b04be6 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 1 Oct 2016 23:28:02 +0200 Subject: ash,hush: add a test that "continue" does not cripple traps Both shells pass this test. Signed-off-by: Denys Vlasenko --- shell/ash_test/ash-signals/continue_and_trap1.right | 1 + shell/ash_test/ash-signals/continue_and_trap1.tests | 7 +++++++ shell/hush_test/hush-signals/continue_and_trap1.right | 1 + shell/hush_test/hush-signals/continue_and_trap1.tests | 7 +++++++ 4 files changed, 16 insertions(+) create mode 100644 shell/ash_test/ash-signals/continue_and_trap1.right create mode 100755 shell/ash_test/ash-signals/continue_and_trap1.tests create mode 100644 shell/hush_test/hush-signals/continue_and_trap1.right create mode 100755 shell/hush_test/hush-signals/continue_and_trap1.tests (limited to 'shell') diff --git a/shell/ash_test/ash-signals/continue_and_trap1.right b/shell/ash_test/ash-signals/continue_and_trap1.right new file mode 100644 index 000000000..d2dd0af72 --- /dev/null +++ b/shell/ash_test/ash-signals/continue_and_trap1.right @@ -0,0 +1 @@ +Exiting diff --git a/shell/ash_test/ash-signals/continue_and_trap1.tests b/shell/ash_test/ash-signals/continue_and_trap1.tests new file mode 100755 index 000000000..2a5c147b1 --- /dev/null +++ b/shell/ash_test/ash-signals/continue_and_trap1.tests @@ -0,0 +1,7 @@ +trap "echo Exiting; exit" INT + +(sleep 1; kill -s INT $$) & + +while continue; do + continue; +done diff --git a/shell/hush_test/hush-signals/continue_and_trap1.right b/shell/hush_test/hush-signals/continue_and_trap1.right new file mode 100644 index 000000000..d2dd0af72 --- /dev/null +++ b/shell/hush_test/hush-signals/continue_and_trap1.right @@ -0,0 +1 @@ +Exiting diff --git a/shell/hush_test/hush-signals/continue_and_trap1.tests b/shell/hush_test/hush-signals/continue_and_trap1.tests new file mode 100755 index 000000000..2a5c147b1 --- /dev/null +++ b/shell/hush_test/hush-signals/continue_and_trap1.tests @@ -0,0 +1,7 @@ +trap "echo Exiting; exit" INT + +(sleep 1; kill -s INT $$) & + +while continue; do + continue; +done -- cgit v1.2.3