Skip to content

Commit

Permalink
Sync tests (#220)
Browse files Browse the repository at this point in the history
We sync the tests for
- change
- knapsack
- roman-numerals
  • Loading branch information
keiravillekode authored Jun 18, 2024
1 parent 8c1974f commit 3c69e3a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions exercises/practice/change/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ description = "possible change without unit coins available"
[9a166411-d35d-4f7f-a007-6724ac266178]
description = "another possible change without unit coins available"

[ce0f80d5-51c3-469d-818c-3e69dbd25f75]
description = "a greedy approach is not optimal"

[bbbcc154-e9e9-4209-a4db-dd6d81ec26bb]
description = "no coins make 0 change"

Expand Down
4 changes: 4 additions & 0 deletions exercises/practice/change/run_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ fn test_another_possible_change_without_unit_coins_available() {
assert find_fewest_coins([4, 5], 27)! == [4, 4, 4, 5, 5, 5]
}

fn test_a_greedy_approach_is_not_optimal() {
assert find_fewest_coins([1, 10, 11], 20)! == [10, 10]
}

fn test_no_coins_make_0_change() {
assert find_fewest_coins([1, 5, 10, 21, 25], 0)! == []
}
Expand Down
5 changes: 5 additions & 0 deletions exercises/practice/knapsack/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

[a4d7d2f0-ad8a-460c-86f3-88ba709d41a7]
description = "no items"
include = false

[3993a824-c20e-493d-b3c9-ee8a7753ee59]
description = "no items"
reimplements = "a4d7d2f0-ad8a-460c-86f3-88ba709d41a7"

[1d39e98c-6249-4a8b-912f-87cb12e506b0]
description = "one item, too heavy"
Expand Down
3 changes: 3 additions & 0 deletions exercises/practice/roman-numerals/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,8 @@ description = "3000 is MMM"
[3bc4b41c-c2e6-49d9-9142-420691504336]
description = "3001 is MMMI"

[2f89cad7-73f6-4d1b-857b-0ef531f68b7e]
description = "3888 is MMMDCCCLXXXVIII"

[4e18e96b-5fbb-43df-a91b-9cb511fe0856]
description = "3999 is MMMCMXCIX"
4 changes: 4 additions & 0 deletions exercises/practice/roman-numerals/run_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ fn test_3001_is_mmmi() {
assert roman(3001) == 'MMMI'
}

fn test_3888_is_mmmdccclxxxviii() {
assert roman(3888) == 'MMMDCCCLXXXVIII'
}

fn test_3999_is_mmmcmxcix() {
assert roman(3999) == 'MMMCMXCIX'
}

0 comments on commit 3c69e3a

Please sign in to comment.