Commit Graph

2 Commits

Author SHA1 Message Date
Luchs
6ac4e99b55 test: add string concatenation test for reduce with folding order
Add test cases demonstrating that the reduce function works with string arrays
and concatenation, verifying both with and without initial accumulator values.
The test uses a list of characters ["W", "o", "r", "l", "d"] and the existing
sum function to show that reduce correctly folds strings in order.
2015-01-16 08:48:59 +00:00
Luchs
afa0a0a8e9 feat: add reduce method to Sequence with two overloads and tests
Implement `reduce` on the `Sequence` class in core.wren with two overloads: one taking an initial accumulator and a function, and another using the first element as the initial accumulator. Add three test files covering normal reduction, single-element edge case, and wrong arity error.
2015-01-15 15:29:49 +00:00