about summary refs log tree commit diff
path: root/Test/E01options.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2017-08-24 19:46:20 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2017-08-24 19:46:20 +0100
commit97d4bdbc7e86e6e8da0d4a059b118ffab289d3a9 (patch)
tree4b00406423534eb1b472ca29401e1683c73d9178 /Test/E01options.ztst
parentd6aa94997750a63712c8928b243b7c61fa73878b (diff)
downloadzsh-97d4bdbc7e86e6e8da0d4a059b118ffab289d3a9.tar.gz
zsh-97d4bdbc7e86e6e8da0d4a059b118ffab289d3a9.tar.xz
zsh-97d4bdbc7e86e6e8da0d4a059b118ffab289d3a9.zip
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.
Diffstat (limited to 'Test/E01options.ztst')
-rw-r--r--Test/E01options.ztst30
1 files changed, 30 insertions, 0 deletions
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