aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/runner
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-09-25 13:40:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-09-25 13:40:11 +0200
commitabcd9e4dcd17fe4bd50bc1d48ceccf6a3894986d (patch)
tree38d24b2580b864af04a3b123b3d1448370cd563a /tests/test/script/runner
parent21bd200819d14f5bba18c2a87cccc18743cd7fde (diff)
Use type-aware iteration in script for-loop (GH issue #436)
Diffstat (limited to 'tests/test/script/runner')
-rw-r--r--tests/test/script/runner/for.testscript13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test/script/runner/for.testscript b/tests/test/script/runner/for.testscript
index f43fcc2..0ca67c3 100644
--- a/tests/test/script/runner/for.testscript
+++ b/tests/test/script/runner/for.testscript
@@ -30,6 +30,19 @@
%.+ -b%
EOO
+ : custom-iteration
+ :
+ $c <<EOI && $b >>EOO
+ j = $json.parse('[1, 2, 3]')
+ for e: $j
+ echo $e >|
+ end
+ EOI
+ 1
+ 2
+ 3
+ EOO
+
: special-var
:
$c <<EOI && $b 2>>EOE != 0