Skip to content

Commit efc33f4

Browse files
authored
Updated tests.toml and regenerated test cases for the Change exercise. (#3656)
New test case added. Retesting needed. See Prob-Specs PR#2385: exercism/problem-specifications#2385
1 parent daae57b commit efc33f4

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

exercises/practice/change/.meta/tests.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ description = "possible change without unit coins available"
3333
[9a166411-d35d-4f7f-a007-6724ac266178]
3434
description = "another possible change without unit coins available"
3535

36+
[ce0f80d5-51c3-469d-818c-3e69dbd25f75]
37+
description = "a greedy approach is not optimal"
38+
3639
[bbbcc154-e9e9-4209-a4db-dd6d81ec26bb]
3740
description = "no coins make 0 change"
3841

exercises/practice/change/change_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# These tests are auto-generated with test data from:
22
# https://github.com/exercism/problem-specifications/tree/main/exercises/change/canonical-data.json
3-
# File last updated on 2023-07-20
3+
# File last updated on 2024-03-05
44

55
import unittest
66

@@ -37,6 +37,9 @@ def test_possible_change_without_unit_coins_available(self):
3737
def test_another_possible_change_without_unit_coins_available(self):
3838
self.assertEqual(find_fewest_coins([4, 5], 27), [4, 4, 4, 5, 5, 5])
3939

40+
def test_a_greedy_approach_is_not_optimal(self):
41+
self.assertEqual(find_fewest_coins([1, 10, 11], 20), [10, 10])
42+
4043
def test_no_coins_make_0_change(self):
4144
self.assertEqual(find_fewest_coins([1, 5, 10, 21, 25], 0), [])
4245

0 commit comments

Comments
 (0)