summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorGokul Soumya <gokulps15@gmail.com>2023-08-21 19:31:27 +0530
committerGitHub <noreply@github.com>2023-08-21 16:01:27 +0200
commit5c6434d4cef8bd1bf3ad2c77f379a8b174939ab9 (patch)
tree7b3070f2368440a6e11920e6f00b6aa458654524 /tests/typ
parent487fddb7cb614c649c7e0fbd61cefbd6f263fd65 (diff)
Add intersperse() method for arrays (#1897)
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/compiler/array.typ7
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), ())