summaryrefslogtreecommitdiff
path: root/tests/typ/compiler/array.typ
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ/compiler/array.typ')
-rw-r--r--tests/typ/compiler/array.typ9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/typ/compiler/array.typ b/tests/typ/compiler/array.typ
index 4bc027ef..e2463cb0 100644
--- a/tests/typ/compiler/array.typ
+++ b/tests/typ/compiler/array.typ
@@ -239,6 +239,15 @@
#test((1, "hi").zip((true, false)), ((1, true), ("hi", false)))
---
+// Test the `enumerate` method.
+#test(().enumerate(), ())
+#test(().enumerate(start: 5), ())
+#test(("a", "b", "c").enumerate(), ((0, "a"), (1, "b"), (2, "c")))
+#test(("a", "b", "c").enumerate(start: 1), ((1, "a"), (2, "b"), (3, "c")))
+#test(("a", "b", "c").enumerate(start: 42), ((42, "a"), (43, "b"), (44, "c")))
+#test(("a", "b", "c").enumerate(start: -7), ((-7, "a"), (-6, "b"), (-5, "c")))
+
+---
// Test the `dedup` method.
#test(().dedup(), ())
#test((1,).dedup(), (1,))