Coverage for src / tests / test_difference_with.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.13.2, created at 2026-02-02 10:52 +0100

1import remedapy as R 

2 

3 

4class TestDifferenceWith: 

5 def test_data_first(self): 

6 # R.difference_with(data, other, isEqual); 

7 assert list( 

8 R.difference_with([{'a': 1}, {'a': 2}, {'a': 3}, {'a': 4}], [2, 5, 3], lambda d, x: d['a'] == x), 

9 ) == [{'a': 1}, {'a': 4}] 

10 

11 def test_data_last(self): 

12 # R.difference_with(other, isEqual)(data); 

13 def cmp(d: dict[str, int], x: int) -> bool: 

14 return d['a'] == x 

15 

16 assert R.pipe( 

17 [{'a': 1}, {'a': 2}, {'a': 3}, {'a': 4}, {'a': 5}, {'a': 6}], 

18 R.difference_with([2, 3], cmp), 

19 list, 

20 ) == [{'a': 1}, {'a': 4}, {'a': 5}, {'a': 6}]