summaryrefslogtreecommitdiff
path: root/tests/suite
diff options
context:
space:
mode:
authorT0mstone <39707032+T0mstone@users.noreply.github.com>2024-05-06 16:02:27 +0200
committerGitHub <noreply@github.com>2024-05-06 14:02:27 +0000
commitc4c53ab52ead548427d66963585b9fa596e85308 (patch)
tree1343800ed3859e55146fbd8e6c166001afc33ade /tests/suite
parent329b0f9b8d9ea5cafbfd6c7a8f92a9d13738b841 (diff)
Add `exact` argument to `array.zip` (#4030)
Diffstat (limited to 'tests/suite')
-rw-r--r--tests/suite/foundations/array.typ10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/suite/foundations/array.typ b/tests/suite/foundations/array.typ
index 7b4c574a..24dad1c1 100644
--- a/tests/suite/foundations/array.typ
+++ b/tests/suite/foundations/array.typ
@@ -350,6 +350,7 @@
#test((1,).zip(()), ())
#test((1,).zip((2,)), ((1, 2),))
#test((1, 2).zip((3, 4)), ((1, 3), (2, 4)))
+#test((1, 2).zip((3, 4), exact: true), ((1, 3), (2, 4)))
#test((1, 2, 3, 4).zip((5, 6)), ((1, 5), (2, 6)))
#test(((1, 2), 3).zip((4, 5)), (((1, 2), 4), (3, 5)))
#test((1, "hi").zip((true, false)), ((1, true), ("hi", false)))
@@ -359,6 +360,15 @@
#test((1, 2, 3).zip(), ((1,), (2,), (3,)))
#test(array.zip(()), ())
+--- array-zip-exact-error ---
+// Error: 13-22 second array has different length (3) from first array (2)
+#(1, 2).zip((1, 2, 3), exact: true)
+
+--- array-zip-exact-multi-error ---
+// Error: 13-22 array has different length (3) from first array (2)
+// Error: 24-36 array has different length (4) from first array (2)
+#(1, 2).zip((1, 2, 3), (1, 2, 3, 4), exact: true)
+
--- array-enumerate ---
// Test the `enumerate` method.
#test(().enumerate(), ())