Skip to content

Commit 2de5f53

Browse files
committed
test_works_with_larger_lists
1 parent 1fc2ba2 commit 2de5f53

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

list_things/tests/test_subset.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class TestSubsetAddingUpTo:
7-
def test_sublist_with_lots_of_number_and_unnatainable_target_returns_none(self):
7+
def test_sublist_with_unnattainable_target_returns_none(self):
88
assert subset_adding_up_to([4, 2, 1], 8) is None
99

1010
@pytest.mark.parametrize(
@@ -21,3 +21,15 @@ def test_sublist_with_lots_of_number_and_unnatainable_target_returns_none(self):
2121
)
2222
def test_returns_subset_adding_up_to_target_sum(self, full_set, target_sum, expected):
2323
assert subset_adding_up_to(full_set, target_sum) == expected
24+
25+
@pytest.mark.parametrize(
26+
"target_sum",
27+
[
28+
1,
29+
943,
30+
77777,
31+
765243,
32+
],
33+
)
34+
def test_works_with_larger_lists(self, target_sum):
35+
assert sum(subset_adding_up_to(list(range(10000000)), target_sum)) == target_sum

0 commit comments

Comments
 (0)