diff options
author | Peter Stephenson <pws@zsh.org> | 2015-07-09 14:58:10 +0100 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2015-07-09 14:59:20 +0100 |
commit | 3af55c858f12fe72eebd6addca89bf6395cae826 (patch) | |
tree | 4bc95951b8f0785a62f94797bcafa7001b38c51c /Test | |
parent | e402747dd6450cafaf1ca6c01671a5adf1595d02 (diff) | |
download | zsh-3af55c858f12fe72eebd6addca89bf6395cae826.tar.gz zsh-3af55c858f12fe72eebd6addca89bf6395cae826.tar.xz zsh-3af55c858f12fe72eebd6addca89bf6395cae826.zip |
35751: Fix ERR_RETURN and ERR_EXIT in "else"
Diffstat (limited to 'Test')
-rw-r--r-- | Test/C03traps.ztst | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst index 757f75ca4..4e2338825 100644 --- a/Test/C03traps.ztst +++ b/Test/C03traps.ztst @@ -399,6 +399,46 @@ ) 1:ERREXIT in loop with simple commands + fn() { + emulate -L zsh + setopt errreturn + if false; then + false + print No. + else + print Oh, yes + fi + } + fn +0:ERRRETURN not triggered in if condition +>Oh, yes + + fn() { + emulate -L zsh + setopt errreturn + if true; then + false + print No. + else + print No, no. + fi + } + fn +1:ERRRETURN in "if" + + fn() { + emulate -L zsh + setopt errreturn + if false; then + print No. + else + false + print No, no. + fi + } + fn +1:ERRRETURN in "else" branch (regression test) + %clean rm -f TRAPEXIT |