diff options
Diffstat (limited to 'Test/A05execution.ztst')
-rw-r--r-- | Test/A05execution.ztst | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst index ca97f4f41..cc2d34d23 100644 --- a/Test/A05execution.ztst +++ b/Test/A05execution.ztst @@ -190,9 +190,9 @@ print "${pipestatus[@]}") ZTST_hashmark done | sort | uniq -c | sed 's/^ *//' -0:Check whether `$pipestatus[]' behaves. +0:Check whether '$pipestatus[]' behaves. >2048 2 1 0 -F:This test checks for a bug in `$pipestatus[]' handling. If it breaks then +F:This test checks for a bug in '$pipestatus[]' handling. If it breaks then F:the bug is still there or it reappeared. See workers-29973 for details. { setopt MONITOR } 2>/dev/null @@ -244,3 +244,45 @@ F:anonymous function, and a descriptor leak when backgrounding a pipeline >autoload_redir () { > print Autoloaded ksh style >} > autoload.log + +# This tests that we record the status of processes that have already exited +# for when we wait for them. +# +# Actually, we don't guarantee here that the jobs have already exited, but +# the order of the waits means it's highly likely we do need to recall a +# previous status, barring accidents which shouldn't happen very often. In +# other words, we rely on the test working repeatedly rather than just +# once. The monitor option is irrelevant to the logic, so we'll make +# our job easier by turning it off. + { unsetopt MONITOR } 2>/dev/null + (exit 1) & + one=$! + (exit 2) & + two=$! + (exit 3) & + three=$! + wait $three + print $? + wait $two + print $? + wait $one +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 |