diff options
| author | Gokul Soumya <gokulps15@gmail.com> | 2023-08-21 19:31:27 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-21 16:01:27 +0200 |
| commit | 5c6434d4cef8bd1bf3ad2c77f379a8b174939ab9 (patch) | |
| tree | 7b3070f2368440a6e11920e6f00b6aa458654524 /tests | |
| parent | 487fddb7cb614c649c7e0fbd61cefbd6f263fd65 (diff) | |
Add intersperse() method for arrays (#1897)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/typ/compiler/array.typ | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/typ/compiler/array.typ b/tests/typ/compiler/array.typ index e2463cb0..96c6c668 100644 --- a/tests/typ/compiler/array.typ +++ b/tests/typ/compiler/array.typ @@ -217,6 +217,13 @@ #([One], [Two], [Three]).join([, ], last: [ and ]). --- +// Test the `intersperse` method +#test(().intersperse("a"), ()) +#test((1,).intersperse("a"), (1,)) +#test((1, 2).intersperse("a"), (1, "a", 2)) +#test((1, 2, "b").intersperse("a"), (1, "a", 2, "a", "b")) + +--- // Test the `sorted` method. #test(().sorted(), ()) #test(().sorted(key: x => x), ()) |
