about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2014-12-27 21:55:58 -0800
committerBarton E. Schaefer <schaefer@zsh.org>2014-12-27 21:55:58 -0800
commitd6a32ddeed914434f5b56b013c9d03b28781d065 (patch)
tree050eb544d08c31b8ad2d443a7563bf68b6b72355 /Test
parent89c692eafb78d4f5a7cf48dc8fc8ab3e5eb73abd (diff)
downloadzsh-d6a32ddeed914434f5b56b013c9d03b28781d065.tar.gz
zsh-d6a32ddeed914434f5b56b013c9d03b28781d065.tar.xz
zsh-d6a32ddeed914434f5b56b013c9d03b28781d065.zip
34065: following an "if" condition, do not test lastval for ERR_EXIT until a new command is run
Includes unposted regression tests.
Diffstat (limited to 'Test')
-rw-r--r--Test/A05execution.ztst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst
index 042b2d0a5..cc2d34d23 100644
--- a/Test/A05execution.ztst
+++ b/Test/A05execution.ztst
@@ -269,3 +269,20 @@ F:anonymous function, and a descriptor leak when backgrounding a pipeline
 1:The status of recently exited background jobs is recorded
 >3
 >2
+
+# Regression test for workers/34060 (patch in 34065)
+  setopt ERR_EXIT NULL_GLOB
+  if false; then :; else echo if:$?; fi
+  if false; then :; else for x in _*_; do :; done; echo for:$?; fi
+0:False "if" condition handled correctly by "for" loops with ERR_EXIT
+>if:1
+>for:0
+
+# Regression test for workers/34065 (uses setopt from preceding test)
+  select x; do :; done; echo $?
+  select x in; do :; done; echo $?
+  select x in _*_; do :; done; echo $?
+0:The status of "select" is zero when the loop body does not execute
+>0
+>0
+>0