diff options
| author | bluebear94 <uruwi@protonmail.com> | 2023-07-29 17:11:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-29 23:11:21 +0200 |
| commit | 66df130ca4c9217d137cba0778d33c8ff9349d33 (patch) | |
| tree | 6f897e2dcd3bcbee0c311ab0d41d1d000b79ef72 /tests/typ | |
| parent | 5bd97e218b698b2ad14fad0470b3b800469ee748 (diff) | |
Add start parameter to array enumerate (#1818)
Diffstat (limited to 'tests/typ')
| -rw-r--r-- | tests/typ/compiler/array.typ | 9 |
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,)) |
