Skip to content

Commit f119566

Browse files
authored
sync tests (#333)
1 parent f281759 commit f119566

File tree

8 files changed

+121
-29
lines changed

8 files changed

+121
-29
lines changed

exercises/practice/anagram/.meta/tests.toml

+6
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,9 @@ include = false
7878
[33d3f67e-fbb9-49d3-a90e-0beb00861da7]
7979
description = "words other than themselves can be anagrams"
8080
reimplements = "a0705568-628c-4b55-9798-82e4acde51ca"
81+
82+
[a6854f66-eec1-4afd-a137-62ef2870c051]
83+
description = "handles case of greek letters"
84+
85+
[fd3509e5-e3ba-409d-ac3d-a9ac84d13296]
86+
description = "different characters may have the same bytes"

exercises/practice/anagram/anagram.test

+10
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,15 @@ test anagram-14 "words other than themselves can be anagrams" -body {
8585
findAnagrams LISTEN {Silent LISTEN}
8686
} -returnCodes ok -result {Silent}
8787

88+
skip anagram-15
89+
test anagram-15 "handles case of greek letters" -body {
90+
findAnagrams ΑΒΓ {ΒΓΑ ΒΓΔ γβα αβγ}
91+
} -returnCodes ok -result {ΒΓΑ γβα}
92+
93+
skip anagram-16
94+
test anagram-16 "different characters may have the same bytes" -body {
95+
findAnagrams "a⬂" [list "€a"]
96+
} -returnCodes ok -result {}
97+
8898

8999
cleanupTests

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

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
# This is an auto-generated file. Regular comments will be removed when this
2-
# file is regenerated. Regenerating will not touch any manually added keys,
3-
# so comments can be added in a "comment" key.
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
411

512
[d0ebd0e1-9d27-4609-a654-df5c0ba1d83a]
613
description = "change for 1 cent"
@@ -26,6 +33,9 @@ description = "possible change without unit coins available"
2633
[9a166411-d35d-4f7f-a007-6724ac266178]
2734
description = "another possible change without unit coins available"
2835

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

exercises/practice/change/change.test

+5
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ test change-1.9 "no coins make 0 change" -body {
5050
findMinimumCoins 0 {1 5 10 21 25}
5151
} -returnCodes ok -result {}
5252

53+
skip change-1.10
54+
test change-1.10 "a greedy approach is not optimal" -body {
55+
findMinimumCoins 20 {1 10 11}
56+
} -returnCodes ok -result {10 10}
57+
5358

5459
skip change-2.1
5560
test change-2.1 "error testing for change smaller than the smallest of coins" -body {
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,61 @@
1-
# This is an auto-generated file. Regular comments will be removed when this
2-
# file is regenerated. Regenerating will not touch any manually added keys,
3-
# so comments can be added in a "comment" key.
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
411

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

5966
[2ca77b9b-c099-46c3-a02c-0d0f68ffa0fe]
6067
description = "each ability is only calculated once"
68+
include = false
69+
70+
[dca2b2ec-f729-4551-84b9-078876bb4808]
71+
description = "each ability is only calculated once"
72+
reimplements = "2ca77b9b-c099-46c3-a02c-0d0f68ffa0fe"

exercises/practice/knapsack/.meta/tests.toml

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
# This is an auto-generated file. Regular comments will be removed when this
2-
# file is regenerated. Regenerating will not touch any manually added keys,
3-
# so comments can be added in a "comment" key.
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
411

512
[a4d7d2f0-ad8a-460c-86f3-88ba709d41a7]
613
description = "no items"
14+
include = false
15+
16+
[3993a824-c20e-493d-b3c9-ee8a7753ee59]
17+
description = "no items"
18+
reimplements = "a4d7d2f0-ad8a-460c-86f3-88ba709d41a7"
719

820
[1d39e98c-6249-4a8b-912f-87cb12e506b0]
921
description = "one item, too heavy"

exercises/practice/poker/.meta/tests.toml

+16
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@ description = "a tie has multiple winners"
2121
[61ed83a9-cfaa-40a5-942a-51f52f0a8725]
2222
description = "multiple hands with the same high cards, tie compares next highest ranked, down to last card"
2323

24+
[da01becd-f5b0-4342-b7f3-1318191d0580]
25+
description = "winning high card hand also has the lowest card"
26+
2427
[f7175a89-34ff-44de-b3d7-f6fd97d1fca4]
2528
description = "one pair beats high card"
2629

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

33+
[b3acd3a7-f9fa-4647-85ab-e0a9e07d1365]
34+
description = "both hands have the same pair, high card wins"
35+
3036
[935bb4dc-a622-4400-97fa-86e7d06b1f76]
3137
description = "two pairs beats one pair"
3238

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

5460
[eb856cc2-481c-4b0d-9835-4d75d07a5d9d]
5561
description = "with multiple decks, two players can have same three of a kind, ties go to highest remaining cards"
62+
include = false
63+
64+
[26a4a7d4-34a2-4f18-90b4-4a8dd35d2bb1]
65+
description = "with multiple decks, two players can have same three of a kind, ties go to highest remaining cards"
66+
reimplements = "eb856cc2-481c-4b0d-9835-4d75d07a5d9d"
5667

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

7889
[4d90261d-251c-49bd-a468-896bf10133de]
7990
description = "both hands have a flush, tie goes to high card, down to the last one if necessary"
91+
include = false
92+
93+
[e04137c5-c19a-4dfc-97a1-9dfe9baaa2ff]
94+
description = "both hands have a flush, tie goes to high card, down to the last one if necessary"
95+
reimplements = "4d90261d-251c-49bd-a468-896bf10133de"
8096

8197
[3a19361d-8974-455c-82e5-f7152f5dba7c]
8298
description = "full house beats a flush"

exercises/practice/poker/poker.test

+25-4
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ test poker-12 "both hands have three of a kind, tie goes to highest ranked tripl
151151
skip poker-13
152152
test poker-13 "with multiple decks, two players can have same three of a kind, ties go to highest remaining cards" -body {
153153
bestHands {
154-
{4S AH AS 7C AD}
154+
{5S AH AS 7C AD}
155155
{4S AH AS 8C AD}
156156
}
157157
} -returnCodes ok -match orderedLists -result {
@@ -232,11 +232,11 @@ test poker-19 "flush beats a straight" -body {
232232
skip poker-20
233233
test poker-20 "both hands have a flush, tie goes to high card, down to the last one if necessary" -body {
234234
bestHands {
235-
{4H 7H 8H 9H 6H}
236-
{2S 4S 5S 6S 7S}
235+
{2H 7H 8H 9H 6H}
236+
{3S 5S 6S 7S 8S}
237237
}
238238
} -returnCodes ok -match orderedLists -result {
239-
{4H 7H 8H 9H 6H}
239+
{2H 7H 8H 9H 6H}
240240
}
241241

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

363+
skip poker-36
364+
test poker-36 "winning high card hand also has the lowest card" -body {
365+
bestHands {
366+
{2S 5H 6S 8D 7H}
367+
{3S 4D 6D 8C 7S}
368+
}
369+
} -returnCodes ok -match orderedLists -result {
370+
{2S 5H 6S 8D 7H}
371+
}
372+
373+
skip poker-37
374+
test poker-37 "both hands have the same pair, high card wins" -body {
375+
bestHands {
376+
"4H 4S AH JC 3D"
377+
"4C 4D AS 5D 6C"
378+
}
379+
} -returnCodes ok -match orderedLists -result {
380+
"4H 4S AH JC 3D"
381+
}
382+
383+
363384
cleanupTests

0 commit comments

Comments
 (0)