summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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
}