From d6a32ddeed914434f5b56b013c9d03b28781d065 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sat, 27 Dec 2014 21:55:58 -0800 Subject: 34065: following an "if" condition, do not test lastval for ERR_EXIT until a new command is run Includes unposted regression tests. --- Test/A05execution.ztst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Test') 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 -- cgit 1.4.1