summaryrefslogtreecommitdiff
path: root/tests/typ/control
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-02-24 18:54:06 +0100
committerLaurenz <laurmaedje@gmail.com>2021-02-24 18:54:06 +0100
commitdae3dad5407e49715736a2a3d8735e65027e6c11 (patch)
treea6742b1ef9e2741170c3dc563032481e9e33e218 /tests/typ/control
parente7cc35073f95800a3dc53cfa6b7f924f47ac618c (diff)
Index + value iteration for arrays 🦚
Diffstat (limited to 'tests/typ/control')
-rw-r--r--tests/typ/control/for-pattern.typ9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/typ/control/for-pattern.typ b/tests/typ/control/for-pattern.typ
index 38253b33..a6a7c16a 100644
--- a/tests/typ/control/for-pattern.typ
+++ b/tests/typ/control/for-pattern.typ
@@ -9,6 +9,11 @@
out += (v,)
}
+// Indices and values of array.
+#for i, v in ("1", "2", "3") {
+ test(repr(i + 1), v)
+}
+
// Values of dictionary.
#for v in (a: 4, b: 5) {
out += (v,)
@@ -23,8 +28,8 @@
#test(out, (1, 2, 3, 4, 5, "a", 6, "b", 7))
---
-// Keys and values of array.
+// Keys and values of strings.
// Error: 6-10 mismatched pattern
-#for k, v in (-1, -2, -3) {
+#for k, v in "hi" {
dont-care
}