From 06099ddead8dc00e86af6e4b87183bac1c3da96c Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 1 Jan 2019 22:01:05 +0100 Subject: [PATCH] tests: Add 43-trap-subshell.sh. * tests/43-trap-subshell.sh: New file. * tests/43-trap-subshell.stdout: New file. * Makefile.am (FULL_TESTS): Add tests/43-trap-subshell.sh. --- Makefile.am | 1 + tests/43-trap-subshell.sh | 5 +++++ tests/43-trap-subshell.stdout | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 tests/43-trap-subshell.sh create mode 100644 tests/43-trap-subshell.stdout diff --git a/Makefile.am b/Makefile.am index a4e5a1f..34853ac 100644 --- a/Makefile.am +++ b/Makefile.am @@ -205,6 +205,7 @@ FULL_TESTS = \ tests/42-sh-export.sh \ tests/42-export-new.sh \ tests/42-sh-export-new.sh \ + tests/43-trap-subshell.sh \ tests/50-iohere.sh \ tests/50-iohere-builtin.sh \ tests/50-redirect.sh \ diff --git a/tests/43-trap-subshell.sh b/tests/43-trap-subshell.sh new file mode 100644 index 0000000..dc8eb21 --- /dev/null +++ b/tests/43-trap-subshell.sh @@ -0,0 +1,5 @@ +trap "rm /tmp/bar$$" 0 +echo foo > /tmp/bar$$ +cat /tmp/bar$$ +(exit 0) +cat /tmp/bar$$ diff --git a/tests/43-trap-subshell.stdout b/tests/43-trap-subshell.stdout new file mode 100644 index 0000000..0d55bed --- /dev/null +++ b/tests/43-trap-subshell.stdout @@ -0,0 +1,2 @@ +foo +foo