summaryrefslogtreecommitdiff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-12-05 12:29:23 +0000
committerPeter Stephenson <pws@zsh.org>2016-12-05 12:29:23 +0000
commit0e4aa6f2f64fb276537adecfe755a752a3fcccb1 (patch)
tree969b5cf504a28cf9b48fbfff3170b187d7d79dfb /Test
parentc03228f9ed28dfaa9ded49eabb93c04def5ac547 (diff)
downloadzsh-0e4aa6f2f64fb276537adecfe755a752a3fcccb1.tar.gz
zsh-0e4aa6f2f64fb276537adecfe755a752a3fcccb1.zip
Additional case for ERR_RETURN and ERR_EXIT.
Don't trigger just because status is non-zero at end of current shell group.
Diffstat (limited to 'Test')
-rw-r--r--Test/C03traps.ztst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst
index e94fb6f85..dc386a44e 100644
--- a/Test/C03traps.ztst
+++ b/Test/C03traps.ztst
@@ -664,6 +664,15 @@ F:Must be tested with a top-level script rather than source or function
>OK
(setopt err_exit
+ {
+ false && true
+ }
+ print OK
+ )
+0:ERR_EXIT not triggered by status 1 at end of { }
+>OK
+
+ (setopt err_exit
for x in y; do
false
done
@@ -696,6 +705,14 @@ F:Must be tested with a top-level script rather than source or function
)
1:ERR_EXIT triggered by status 1 within if
+ (setopt err_exit
+ {
+ false
+ }
+ print OK
+ )
+1:ERR_EXIT triggered by status 1 within { }
+
if zmodload zsh/system 2>/dev/null; then
(
trap 'echo TERM; exit 2' TERM