about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <p.stephenson@samsung.com>2023-03-29 10:52:05 +0100
committerPeter Stephenson <p.stephenson@samsung.com>2023-03-29 10:52:05 +0100
commit12e5db145b098a62ff11b88eea26f473ea2ecdcf (patch)
tree147e2f424d37ef02f9fd97cda3477cc79a1e5466 /Test
parent6d40d9b63b41188cc846918e19bbf2982b9305b9 (diff)
downloadzsh-12e5db145b098a62ff11b88eea26f473ea2ecdcf.tar.gz
zsh-12e5db145b098a62ff11b88eea26f473ea2ecdcf.tar.xz
zsh-12e5db145b098a62ff11b88eea26f473ea2ecdcf.zip
51608: Don't execute commands after "continue &&"
Also ! continue ||
Diffstat (limited to 'Test')
-rw-r--r--Test/A01grammar.ztst36
1 files changed, 36 insertions, 0 deletions
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index b3aea1055..d57085798 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -982,3 +982,39 @@ F:its expectations.
  }
  fn
 1:! does not affect return status of explicit return
+
+  msg=unset
+  for x in 1 2 3 4 5; do
+    continue && msg=set && print Not executed
+    print Not executed, neither.
+  done
+  print $msg
+0:continue causes immediate continuation
+>unset
+
+  msg=unset
+  () {
+    return && msg=set && print Not executed
+    print Not executed, not nor neither.
+  }
+  print $msg
+0:return causes immediate return
+>unset
+
+  msg=unset
+  for x in 1 2 3 4 5; do
+    ! continue || msg=set && print Not executed
+    print Not executed, neither.
+  done
+  print $msg
+0:! continue causes immediate continuation
+>unset
+
+  msg=unset
+  () {
+    ! return || msg=set && print Not executed
+    print Not executed, not nor neither.
+  }
+  print $msg
+0:! return causes immediate return
+>unset