From 97d4bdbc7e86e6e8da0d4a059b118ffab289d3a9 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 24 Aug 2017 19:46:20 +0100 Subject: 41590 modified as 41595: make ERR_RETURN more logical. It now operates separately at each function depth. To keep ERR_EXIT global, make the noerrexit variable usd bit flags. Extend tests. --- Test/E01options.ztst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'Test/E01options.ztst') diff --git a/Test/E01options.ztst b/Test/E01options.ztst index f01d83567..8101ff539 100644 --- a/Test/E01options.ztst +++ b/Test/E01options.ztst @@ -345,6 +345,36 @@ >ZERR trapped >off after + ( + setopt ERR_EXIT + () { false; print is executed; } && true + () { false; print is not executed; } + print is not executed + ) +1:ERR_EXIT is suppressed within a function followed by "&&" +>is executed + + ( + setopt ERR_RETURN + () { false; print is not executed; } || print is executed + print is also executed + ) +0:ERR_RETURN is not suppressed within a function followed by "||" +>is executed +>is also executed + + ( + setopt ERR_RETURN + () { + () { false; print Not executed 1; } || true + print Executed + () { false; print Not executed 2; } + print Not executed 3; + } && false + ) +1:ERR_RETURN with additional levels +>Executed + (print before; setopt noexec; print after) 0:NO_EXEC option >before -- cgit 1.4.1