From 66df130ca4c9217d137cba0778d33c8ff9349d33 Mon Sep 17 00:00:00 2001 From: bluebear94 Date: Sat, 29 Jul 2023 17:11:21 -0400 Subject: Add start parameter to array enumerate (#1818) --- tests/typ/compiler/array.typ | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/typ/compiler/array.typ') 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 @@ -238,6 +238,15 @@ #test(((1, 2), 3).zip((4, 5)), (((1, 2), 4), (3, 5))) #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(), ()) -- cgit v1.2.3