diff options
| author | JustForFun88 <100504524+JustForFun88@users.noreply.github.com> | 2024-04-30 17:21:40 +0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-30 12:21:40 +0000 |
| commit | d7838ab1288672a67fc746a89eb6a04c7ed8c8cf (patch) | |
| tree | ce879cb638093f01a6741392b5b253f36773d83e /tests/suite | |
| parent | 97de0a0595d28e29d944112ab6e06700d9c9d73d (diff) | |
Add `reduce` method to `array` (#3911)
Diffstat (limited to 'tests/suite')
| -rw-r--r-- | tests/suite/foundations/array.typ | 13 |
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 |
