From 12e5db145b098a62ff11b88eea26f473ea2ecdcf Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Wed, 29 Mar 2023 10:52:05 +0100
Subject: 51608: Don't execute commands after "continue &&"
Also ! continue ||
---
Test/A01grammar.ztst | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
(limited to 'Test')
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
--
cgit 1.4.1