Skip to content

Commit b4d624c

Browse files
authored
Sync tests (#324)
* roman-numerals * pig-latin * bob * protein-translation * do not include wide char tests or grapheme tests
1 parent 2b5ae3f commit b4d624c

File tree

10 files changed

+50
-6
lines changed

10 files changed

+50
-6
lines changed

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

+8
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,11 @@ 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+
include = false
85+
86+
[fd3509e5-e3ba-409d-ac3d-a9ac84d13296]
87+
description = "different characters may have the same bytes"
88+
include = false

exercises/practice/bob/.meta/tests.toml

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ description = "alternate silence"
7171

7272
[66953780-165b-4e7e-8ce3-4bcb80b6385a]
7373
description = "multiple line question"
74+
include = false
7475

7576
[5371ef75-d9ea-4103-bcfa-2da973ddec1b]
7677
description = "starting with whitespace"
@@ -83,3 +84,7 @@ description = "other whitespace"
8384

8485
[12983553-8601-46a8-92fa-fcaa3bc4a2a0]
8586
description = "non-question ending with whitespace"
87+
88+
[2c7278ac-f955-4eb4-bf8f-e33eb4116a15]
89+
description = "multiple line question"
90+
reimplements = "66953780-165b-4e7e-8ce3-4bcb80b6385a"

exercises/practice/bob/test.sml

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ val testsuite =
6969
(fn _ => response ("\t\t\t\t\t\t\t\t\t\t") |> Expect.equalTo "Fine. Be that way!"),
7070

7171
test "multiple line question"
72-
(fn _ => response ("\nDoes this cryogenic chamber make me look fat?\nNo.") |> Expect.equalTo "Whatever."),
72+
(fn _ => response ("\nDoes this cryogenic chamber make\n me look fat?") |> Expect.equalTo "Sure."),
7373

7474
test "starting with whitespace"
7575
(fn _ => response (" hmmmmmmm...") |> Expect.equalTo "Whatever."),
@@ -84,4 +84,4 @@ val testsuite =
8484
(fn _ => response ("This is a statement ending with whitespace ") |> Expect.equalTo "Whatever.")
8585
]
8686

87-
val _ = Test.run testsuite
87+
val _ = Test.run testsuite

exercises/practice/pig-latin/.meta/tests.toml

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ description = "first letter and ay are moved to the end of words that start with
3939
[bce94a7a-a94e-4e2b-80f4-b2bb02e40f71]
4040
description = "first letter and ay are moved to the end of words that start with consonants -> word beginning with q without a following u"
4141

42+
[e59dbbe8-ccee-4619-a8e9-ce017489bfc0]
43+
description = "first letter and ay are moved to the end of words that start with consonants -> word beginning with consonant and vowel containing qu"
44+
4245
[c01e049a-e3e2-451c-bf8e-e2abb7e438b8]
4346
description = "some letter clusters are treated like a single consonant -> word beginning with ch"
4447

exercises/practice/pig-latin/test.sml

+5-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ val testsuite =
3939
(fn _ => translate ("xenon") |> Expect.equalTo "enonxay"),
4040

4141
test "word beginning with q without a following u"
42-
(fn _ => translate ("qat") |> Expect.equalTo "atqay")
42+
(fn _ => translate ("qat") |> Expect.equalTo "atqay"),
43+
44+
test "word beginning with consonant and vowel containing qu"
45+
(fn _ => translate ("liquid") |> Expect.equalTo "iquidlay")
4346
],
4447

4548
describe "some letter clusters are treated like a single consonant" [
@@ -87,4 +90,4 @@ val testsuite =
8790
]
8891
]
8992

90-
val _ = Test.run testsuite
93+
val _ = Test.run testsuite

exercises/practice/protein-translation/.meta/tests.toml

+4
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,15 @@ description = "Translation stops if STOP codon in middle of three-codon sequence
8787
[2c2a2a60-401f-4a80-b977-e0715b23b93d]
8888
description = "Translation stops if STOP codon in middle of six-codon sequence"
8989

90+
[f6f92714-769f-4187-9524-e353e8a41a80]
91+
description = "Sequence of two non-STOP codons does not translate to a STOP codon"
92+
9093
[1e75ea2a-f907-4994-ae5c-118632a1cb0f]
9194
description = "Non-existing codon can't translate"
9295

9396
[9eac93f3-627a-4c90-8653-6d0a0595bc6f]
9497
description = "Unknown amino acids, not part of a codon, can't translate"
98+
reimplements = "1e75ea2a-f907-4994-ae5c-118632a1cb0f"
9599

96100
[9d73899f-e68e-4291-b1e2-7bf87c00f024]
97101
description = "Incomplete RNA sequence can't translate"

exercises/practice/protein-translation/test.sml

+3
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ val testsuite =
8686
test "Translation stops if STOP codon in middle of six-codon sequence"
8787
(fn _ => proteins "UGGUGUUAUUAAUGGUUU" |> Expect.equalTo ["Tryptophan", "Cysteine", "Tyrosine"]),
8888

89+
test "Sequence of two non-STOP codons does not translate to a STOP codon"
90+
(fn _ => proteins "AUGAUG" |> Expect.equalTo ["Methionine", "Methionine"]),
91+
8992
test "Non-existing codon can't translate"
9093
(fn _ => (fn _ => proteins "AAA") |> Expect.error (Fail "Invalid codon")),
9194

exercises/practice/reverse-string/.meta/tests.toml

+12
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,15 @@ description = "a palindrome"
2626

2727
[b9e7dec1-c6df-40bd-9fa3-cd7ded010c4c]
2828
description = "an even-sized word"
29+
30+
[1bed0f8a-13b0-4bd3-9d59-3d0593326fa2]
31+
description = "wide characters"
32+
include = false
33+
34+
[93d7e1b8-f60f-4f3c-9559-4056e10d2ead]
35+
description = "grapheme cluster with pre-combined form"
36+
include = false
37+
38+
[1028b2c1-6763-4459-8540-2da47ca512d9]
39+
description = "grapheme clusters"
40+
include = false

exercises/practice/roman-numerals/.meta/tests.toml

+3
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,8 @@ description = "3000 is MMM"
8484
[3bc4b41c-c2e6-49d9-9142-420691504336]
8585
description = "3001 is MMMI"
8686

87+
[2f89cad7-73f6-4d1b-857b-0ef531f68b7e]
88+
description = "3888 is MMMDCCCLXXXVIII"
89+
8790
[4e18e96b-5fbb-43df-a91b-9cb511fe0856]
8891
description = "3999 is MMMCMXCIX"

exercises/practice/roman-numerals/test.sml

+5-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ val testsuite =
8484
(fn _ => roman (3001) |> Expect.equalTo "MMMI"),
8585

8686
test "3999 is MMMCMXCIX"
87-
(fn _ => roman (3999) |> Expect.equalTo "MMMCMXCIX")
87+
(fn _ => roman (3999) |> Expect.equalTo "MMMCMXCIX"),
88+
89+
test "3888 is MMMDCCCLXXXVIII"
90+
(fn _ => roman (3888) |> Expect.equalTo "MMMDCCCLXXXVIII")
8891
]
8992

90-
val _ = Test.run testsuite
93+
val _ = Test.run testsuite

0 commit comments

Comments
 (0)