summaryrefslogtreecommitdiff
path: root/tests/suite
diff options
context:
space:
mode:
authorJustForFun88 <100504524+JustForFun88@users.noreply.github.com>2024-04-30 17:21:40 +0500
committerGitHub <noreply@github.com>2024-04-30 12:21:40 +0000
commitd7838ab1288672a67fc746a89eb6a04c7ed8c8cf (patch)
treece879cb638093f01a6741392b5b253f36773d83e /tests/suite
parent97de0a0595d28e29d944112ab6e06700d9c9d73d (diff)
Add `reduce` method to `array` (#3911)
Diffstat (limited to 'tests/suite')
-rw-r--r--tests/suite/foundations/array.typ13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/suite/foundations/array.typ b/tests/suite/foundations/array.typ
index 3992d75e..336c5a67 100644
--- a/tests/suite/foundations/array.typ
+++ b/tests/suite/foundations/array.typ
@@ -492,3 +492,16 @@
--- array-unclosed ---
// Error: 3-4 unclosed delimiter
#{(}
+
+--- array-reduce ---
+// Test the `reduce` method.
+#test(().reduce(grid), none)
+#test((1, 2, 3, 4).reduce((s, x) => s + x), 10)
+
+--- array-reduce-missing-reducer ---
+// Error: 2-13 missing argument: reducer
+#().reduce()
+
+--- array-reduce-unexpected-argument ---
+// Error: 19-21 unexpected argument
+#(1, 2, 3).reduce(() => none) \ No newline at end of file