about summary refs log tree commit diff
path: root/Test/C03traps.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-10-05 13:52:31 +0100
committerPeter Stephenson <pws@zsh.org>2016-10-05 13:52:31 +0100
commit0854ee56bc559d7fd614eb7d59b61da84a9ce51f (patch)
tree08c823e058470f679054797bde81e8e73ce80b1d /Test/C03traps.ztst
parentd033f03688f3c8a307c656ffe465340a24053122 (diff)
downloadzsh-0854ee56bc559d7fd614eb7d59b61da84a9ce51f.tar.gz
zsh-0854ee56bc559d7fd614eb7d59b61da84a9ce51f.tar.xz
zsh-0854ee56bc559d7fd614eb7d59b61da84a9ce51f.zip
39568: "! <complex-command>" suppresses ERR_EXIT
Diffstat (limited to 'Test/C03traps.ztst')
-rw-r--r--Test/C03traps.ztst27
1 files changed, 27 insertions, 0 deletions
diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst
index 3a65b2876..0faec02e9 100644
--- a/Test/C03traps.ztst
+++ b/Test/C03traps.ztst
@@ -556,6 +556,33 @@ F:Must be tested with a top-level script rather than source or function
 1:ERRETURN with "!" and a following false
 >before
 
+  fn() {
+      emulate -L zsh
+      setopt errreturn
+      print before
+      ! if true; then
+        false
+      fi
+      print after
+  }
+  fn
+0:ERRETURN with "!" suppressed inside complex structure
+>before
+>after
+
+  fn() {
+      emulate -L zsh
+      setopt errreturn
+      print before
+      if true; then
+        false
+      fi
+      print after
+  }
+  fn
+1:ERRETURN with no "!" suppression (control case)
+>before
+
 %clean
 
   rm -f TRAPEXIT