Skip to content

Commit

Permalink
sync tests (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
glennj authored Apr 2, 2024
1 parent f281759 commit f119566
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 29 deletions.
6 changes: 6 additions & 0 deletions exercises/practice/anagram/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,9 @@ include = false
[33d3f67e-fbb9-49d3-a90e-0beb00861da7]
description = "words other than themselves can be anagrams"
reimplements = "a0705568-628c-4b55-9798-82e4acde51ca"

[a6854f66-eec1-4afd-a137-62ef2870c051]
description = "handles case of greek letters"

[fd3509e5-e3ba-409d-ac3d-a9ac84d13296]
description = "different characters may have the same bytes"
10 changes: 10 additions & 0 deletions exercises/practice/anagram/anagram.test
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,15 @@ test anagram-14 "words other than themselves can be anagrams" -body {
findAnagrams LISTEN {Silent LISTEN}
} -returnCodes ok -result {Silent}

skip anagram-15
test anagram-15 "handles case of greek letters" -body {
findAnagrams ΑΒΓ {ΒΓΑ ΒΓΔ γβα αβγ}
} -returnCodes ok -result {ΒΓΑ γβα}

skip anagram-16
test anagram-16 "different characters may have the same bytes" -body {
findAnagrams "a⬂" [list "€a"]
} -returnCodes ok -result {}


cleanupTests
16 changes: 13 additions & 3 deletions exercises/practice/change/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# This is an auto-generated file. Regular comments will be removed when this
# file is regenerated. Regenerating will not touch any manually added keys,
# so comments can be added in a "comment" key.
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

[d0ebd0e1-9d27-4609-a654-df5c0ba1d83a]
description = "change for 1 cent"
Expand All @@ -26,6 +33,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
5 changes: 5 additions & 0 deletions exercises/practice/change/change.test
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ test change-1.9 "no coins make 0 change" -body {
findMinimumCoins 0 {1 5 10 21 25}
} -returnCodes ok -result {}

skip change-1.10
test change-1.10 "a greedy approach is not optimal" -body {
findMinimumCoins 20 {1 10 11}
} -returnCodes ok -result {10 10}


skip change-2.1
test change-2.1 "error testing for change smaller than the smallest of coins" -body {
Expand Down
50 changes: 31 additions & 19 deletions exercises/practice/dnd-character/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -1,54 +1,61 @@
# This is an auto-generated file. Regular comments will be removed when this
# file is regenerated. Regenerating will not touch any manually added keys,
# so comments can be added in a "comment" key.
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

[1e9ae1dc-35bd-43ba-aa08-e4b94c20fa37]
description = "ability modifier for score 3 is -4"
description = "ability modifier -> ability modifier for score 3 is -4"

[cc9bb24e-56b8-4e9e-989d-a0d1a29ebb9c]
description = "ability modifier for score 4 is -3"
description = "ability modifier -> ability modifier for score 4 is -3"

[5b519fcd-6946-41ee-91fe-34b4f9808326]
description = "ability modifier for score 5 is -3"
description = "ability modifier -> ability modifier for score 5 is -3"

[dc2913bd-6d7a-402e-b1e2-6d568b1cbe21]
description = "ability modifier for score 6 is -2"
description = "ability modifier -> ability modifier for score 6 is -2"

[099440f5-0d66-4b1a-8a10-8f3a03cc499f]
description = "ability modifier for score 7 is -2"
description = "ability modifier -> ability modifier for score 7 is -2"

[cfda6e5c-3489-42f0-b22b-4acb47084df0]
description = "ability modifier for score 8 is -1"
description = "ability modifier -> ability modifier for score 8 is -1"

[c70f0507-fa7e-4228-8463-858bfbba1754]
description = "ability modifier for score 9 is -1"
description = "ability modifier -> ability modifier for score 9 is -1"

[6f4e6c88-1cd9-46a0-92b8-db4a99b372f7]
description = "ability modifier for score 10 is 0"
description = "ability modifier -> ability modifier for score 10 is 0"

[e00d9e5c-63c8-413f-879d-cd9be9697097]
description = "ability modifier for score 11 is 0"
description = "ability modifier -> ability modifier for score 11 is 0"

[eea06f3c-8de0-45e7-9d9d-b8cab4179715]
description = "ability modifier for score 12 is +1"
description = "ability modifier -> ability modifier for score 12 is +1"

[9c51f6be-db72-4af7-92ac-b293a02c0dcd]
description = "ability modifier for score 13 is +1"
description = "ability modifier -> ability modifier for score 13 is +1"

[94053a5d-53b6-4efc-b669-a8b5098f7762]
description = "ability modifier for score 14 is +2"
description = "ability modifier -> ability modifier for score 14 is +2"

[8c33e7ca-3f9f-4820-8ab3-65f2c9e2f0e2]
description = "ability modifier for score 15 is +2"
description = "ability modifier -> ability modifier for score 15 is +2"

[c3ec871e-1791-44d0-b3cc-77e5fb4cd33d]
description = "ability modifier for score 16 is +3"
description = "ability modifier -> ability modifier for score 16 is +3"

[3d053cee-2888-4616-b9fd-602a3b1efff4]
description = "ability modifier for score 17 is +3"
description = "ability modifier -> ability modifier for score 17 is +3"

[bafd997a-e852-4e56-9f65-14b60261faee]
description = "ability modifier for score 18 is +4"
description = "ability modifier -> ability modifier for score 18 is +4"

[4f28f19c-2e47-4453-a46a-c0d365259c14]
description = "random ability is within range"
Expand All @@ -58,3 +65,8 @@ description = "random character is valid"

[2ca77b9b-c099-46c3-a02c-0d0f68ffa0fe]
description = "each ability is only calculated once"
include = false

[dca2b2ec-f729-4551-84b9-078876bb4808]
description = "each ability is only calculated once"
reimplements = "2ca77b9b-c099-46c3-a02c-0d0f68ffa0fe"
18 changes: 15 additions & 3 deletions exercises/practice/knapsack/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
# This is an auto-generated file. Regular comments will be removed when this
# file is regenerated. Regenerating will not touch any manually added keys,
# so comments can be added in a "comment" key.
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

[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
16 changes: 16 additions & 0 deletions exercises/practice/poker/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ description = "a tie has multiple winners"
[61ed83a9-cfaa-40a5-942a-51f52f0a8725]
description = "multiple hands with the same high cards, tie compares next highest ranked, down to last card"

[da01becd-f5b0-4342-b7f3-1318191d0580]
description = "winning high card hand also has the lowest card"

[f7175a89-34ff-44de-b3d7-f6fd97d1fca4]
description = "one pair beats high card"

[e114fd41-a301-4111-a9e7-5a7f72a76561]
description = "highest pair wins"

[b3acd3a7-f9fa-4647-85ab-e0a9e07d1365]
description = "both hands have the same pair, high card wins"

[935bb4dc-a622-4400-97fa-86e7d06b1f76]
description = "two pairs beats one pair"

Expand All @@ -53,6 +59,11 @@ description = "both hands have three of a kind, tie goes to highest ranked tripl

[eb856cc2-481c-4b0d-9835-4d75d07a5d9d]
description = "with multiple decks, two players can have same three of a kind, ties go to highest remaining cards"
include = false

[26a4a7d4-34a2-4f18-90b4-4a8dd35d2bb1]
description = "with multiple decks, two players can have same three of a kind, ties go to highest remaining cards"
reimplements = "eb856cc2-481c-4b0d-9835-4d75d07a5d9d"

[a858c5d9-2f28-48e7-9980-b7fa04060a60]
description = "a straight beats three of a kind"
Expand All @@ -77,6 +88,11 @@ description = "flush beats a straight"

[4d90261d-251c-49bd-a468-896bf10133de]
description = "both hands have a flush, tie goes to high card, down to the last one if necessary"
include = false

[e04137c5-c19a-4dfc-97a1-9dfe9baaa2ff]
description = "both hands have a flush, tie goes to high card, down to the last one if necessary"
reimplements = "4d90261d-251c-49bd-a468-896bf10133de"

[3a19361d-8974-455c-82e5-f7152f5dba7c]
description = "full house beats a flush"
Expand Down
29 changes: 25 additions & 4 deletions exercises/practice/poker/poker.test
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ test poker-12 "both hands have three of a kind, tie goes to highest ranked tripl
skip poker-13
test poker-13 "with multiple decks, two players can have same three of a kind, ties go to highest remaining cards" -body {
bestHands {
{4S AH AS 7C AD}
{5S AH AS 7C AD}
{4S AH AS 8C AD}
}
} -returnCodes ok -match orderedLists -result {
Expand Down Expand Up @@ -232,11 +232,11 @@ test poker-19 "flush beats a straight" -body {
skip poker-20
test poker-20 "both hands have a flush, tie goes to high card, down to the last one if necessary" -body {
bestHands {
{4H 7H 8H 9H 6H}
{2S 4S 5S 6S 7S}
{2H 7H 8H 9H 6H}
{3S 5S 6S 7S 8S}
}
} -returnCodes ok -match orderedLists -result {
{4H 7H 8H 9H 6H}
{2H 7H 8H 9H 6H}
}

skip poker-21
Expand Down Expand Up @@ -360,4 +360,25 @@ test poker-35 "even though an ace is usually high, a 5-high straight flush is th
{2H 3H 4H 5H 6H}
}

skip poker-36
test poker-36 "winning high card hand also has the lowest card" -body {
bestHands {
{2S 5H 6S 8D 7H}
{3S 4D 6D 8C 7S}
}
} -returnCodes ok -match orderedLists -result {
{2S 5H 6S 8D 7H}
}

skip poker-37
test poker-37 "both hands have the same pair, high card wins" -body {
bestHands {
"4H 4S AH JC 3D"
"4C 4D AS 5D 6C"
}
} -returnCodes ok -match orderedLists -result {
"4H 4S AH JC 3D"
}


cleanupTests

0 comments on commit f119566

Please sign in to comment.