Coverage for src / tests / test_reduce.py: 100%
7 statements
« prev ^ index » next coverage.py v7.13.2, created at 2026-02-02 10:52 +0100
« prev ^ index » next coverage.py v7.13.2, created at 2026-02-02 10:52 +0100
1import remedapy as R
4class TestReduce:
5 def test_data_first(self):
6 # R.reduce(data, callbackfn, initialValue);
7 assert R.reduce([1, 2, 3, 4, 5], lambda a, x: a + x, 100) == 115
9 def test_data_last(self):
10 # R.reduce(callbackfn, initialValue)(data);
11 assert R.reduce(R.add, 100)([1, 2, 3, 4, 5]) == 115
12 assert R.pipe([1, 2, 3, 4, 5], R.reduce(R.add, 100)) == 115