Coverage for src / tests / test_all_pass.py: 100%
12 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
1from collections.abc import Callable
3import remedapy as R
6def is_divisible_by(n: int) -> Callable[[int], bool]:
7 return lambda x: x % n == 0
10fns = [is_divisible_by(3), is_divisible_by(4)]
13class TestAllPass:
14 def test_data_first(self):
15 # R.all_pass(data, fns);
16 assert R.all_pass(12, fns)
17 assert not R.all_pass(10, fns)
19 def test_data_last(self):
20 # R.all_pass(fns)(data);
21 assert R.all_pass(fns)(12)
22 assert not R.all_pass(fns)(10)