about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-05-05 09:49:39 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-05-05 09:49:39 +0000
commita6ea7ab36d73093f3de2d4ae8bdcff22ae474525 (patch)
treeed64efa350b80bdf47c8d8323cecfa497641804f /Test
parentb0aec8054ca08d82e31b6f83376586e3c174c5d4 (diff)
downloadzsh-a6ea7ab36d73093f3de2d4ae8bdcff22ae474525.tar.gz
zsh-a6ea7ab36d73093f3de2d4ae8bdcff22ae474525.tar.xz
zsh-a6ea7ab36d73093f3de2d4ae8bdcff22ae474525.zip
27947: some cases where we should execute EXIT traps
Diffstat (limited to 'Test')
-rw-r--r--Test/C03traps.ztst20
1 files changed, 20 insertions, 0 deletions
diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst
index 7c4501413..853ae1aa0 100644
--- a/Test/C03traps.ztst
+++ b/Test/C03traps.ztst
@@ -350,6 +350,26 @@
 >trap
 >Working 0
 
+   { trap 'echo This subshell is exiting' EXIT; } | cat
+0: EXIT trap set in current shell at left of pipeline
+>This subshell is exiting  
+
+   ( trap 'echo This subshell is also exiting' EXIT; ) | cat
+0: EXIT trap set in subshell at left of pipeline
+>This subshell is also exiting  
+
+   ( trap 'echo Should only appear once at the end' EXIT
+     ( : trap reset here ) | cat
+     : trap not reset but not part of shell command list | cat
+     echo nothing after this should appear $( : trap reset here too)
+   )
+0: EXIT trap set in subshell reset in subsubshell
+>nothing after this should appear
+>Should only appear once at the end  
+
+   echo $( trap 'echo command substitution exited' EXIT )
+0: EXIT trap set in command substitution
+>command substitution exited  
 
 %clean