From 5c6434d4cef8bd1bf3ad2c77f379a8b174939ab9 Mon Sep 17 00:00:00 2001 From: Gokul Soumya Date: Mon, 21 Aug 2023 19:31:27 +0530 Subject: Add intersperse() method for arrays (#1897) --- tests/typ/compiler/array.typ | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/typ/compiler/array.typ') 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 @@ -216,6 +216,13 @@ // Ref: true #([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(), ()) -- cgit v1.2.3