about summary refs log tree commit diff
path: root/Test/C03traps.ztst
diff options
context:
space:
mode:
Diffstat (limited to 'Test/C03traps.ztst')
-rw-r--r--Test/C03traps.ztst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst
index d8183a428..f4466b556 100644
--- a/Test/C03traps.ztst
+++ b/Test/C03traps.ztst
@@ -419,6 +419,23 @@
 >end of program
 >EXIT TRAP TRIGGERED
 
+   (cd ..; $ZTST_exe -fc '
+     echo entering program
+     emulate sh -c '\''trap "echo POSIX exit trap triggered" EXIT'\''
+     fn() {
+        trap "echo native zsh function-local exit trap triggered" EXIT
+        echo entering native zsh function
+     }
+     fn
+     echo exiting program
+   ')
+0:POSX EXIT trap can have nested native mode EXIT trap
+>entering program
+>entering native zsh function
+>native zsh function-local exit trap triggered
+>exiting program
+>POSIX exit trap triggered
+
    (set -e
     printf "a\nb\n" | while read line
     do