about summary refs log tree commit diff
path: root/Test/C03traps.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-11-08 13:02:24 +0000
committerPeter Stephenson <pws@zsh.org>2016-11-08 13:02:57 +0000
commita57977d01acc3b1b63aec1b79394ef7ffd052912 (patch)
tree31453161137d799ce25232a58bd0c116a9c2a621 /Test/C03traps.ztst
parentdfb2f3f3d24f40012d129d3c205c9ca149f1bc1e (diff)
downloadzsh-a57977d01acc3b1b63aec1b79394ef7ffd052912.tar.gz
zsh-a57977d01acc3b1b63aec1b79394ef7ffd052912.tar.xz
zsh-a57977d01acc3b1b63aec1b79394ef7ffd052912.zip
39870: ensure exit trap can always run
Diffstat (limited to 'Test/C03traps.ztst')
-rw-r--r--Test/C03traps.ztst15
1 files changed, 15 insertions, 0 deletions
diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst
index 74b83f33a..828a3d10f 100644
--- a/Test/C03traps.ztst
+++ b/Test/C03traps.ztst
@@ -626,6 +626,21 @@ F:Must be tested with a top-level script rather than source or function
 >before-out
 >before-in
 
+  if zmodload zsh/system 2>/dev/null; then
+  (
+    trap 'echo TERM; exit 2' TERM
+    trap 'echo EXIT' EXIT
+    kill -s TERM "$sysparams[pid]"
+    echo 'FATAL: we should never get here!' 1>&2
+    exit 1
+  )
+  else
+    ZTST_skip="zsh/system library not found."
+  fi
+2:EXIT trap from TERM trap
+>TERM
+>EXIT
+
 %clean
 
   rm -f TRAPEXIT