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.ztst14
1 files changed, 14 insertions, 0 deletions
diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst
index 92b17ce41..79a30d773 100644
--- a/Test/C03traps.ztst
+++ b/Test/C03traps.ztst
@@ -350,6 +350,7 @@
 >trap
 >Working 0
 
+  unsetopt DEBUG_BEFORE_CMD
   debug-trap-bug1() {
     setopt localtraps
     print "print bug file here" >bug-file
@@ -388,6 +389,19 @@
 >bug file here
 >EXIT hit
 
+  cat >zsh-trapreturn-bug2 <<-'HERE'
+	cmd='./fdasfsdafd'
+	[[ -x $cmd ]] && rm $cmd
+	set -o DEBUG_BEFORE_CMD
+	trap '[[ $? -ne 0 ]] && exit 0' DEBUG
+	$cmd  # invalid command
+	# Failure
+	exit 10
+	HERE
+  $ZTST_testdir/../Src/zsh -f ./zsh-trapreturn-bug2
+0: trapreturn handling bug is properly fixed
+?./zsh-trapreturn-bug2:5: no such file or directory: ./fdasfsdafd
+
 %clean
 
   rm -f TRAPEXIT