From c4c53ab52ead548427d66963585b9fa596e85308 Mon Sep 17 00:00:00 2001 From: T0mstone <39707032+T0mstone@users.noreply.github.com> Date: Mon, 6 May 2024 16:02:27 +0200 Subject: Add `exact` argument to `array.zip` (#4030) --- tests/suite/foundations/array.typ | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') 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(), ()) -- cgit v1.2.3