Skip to content

Commit

Permalink
add missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegillet committed May 17, 2024
1 parent 01065fb commit ef66275
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 17 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"
9 changes: 7 additions & 2 deletions exercises/practice/anagram/tests/Tests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ tests =
Expect.equal []
(detect "mass" [ "last" ])
, skip <|
test "detects unicode anagrams" <|
test "handles case of greek letters" <|
\() ->
Expect.equal [ "ΒΓΑ", "γβα" ]
(detect "ΑΒΓ" [ "ΒΓΑ", "ΒΓΔ", "γβα" ])
(detect "ΑΒΓ" [ "ΒΓΑ", "ΒΓΔ", "γβα", "αβγ" ])
, skip <|
test "eliminates misleading unicode anagrams" <|
\() ->
Expand All @@ -117,4 +117,9 @@ tests =
\() ->
Expect.equal []
(detect "patter" [ "tapper" ])
, skip <|
test "different characters may have the same bytes" <|
\() ->
Expect.equal []
(detect "a⬂" [ "€a" ])
]
3 changes: 3 additions & 0 deletions exercises/practice/custom-set/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ description = "Difference (or Complement) of a set is a set of all elements that
[c5ac673e-d707-4db5-8d69-7082c3a5437e]
description = "Difference (or Complement) of a set is a set of all elements that are only in the first set -> difference of two non-empty sets is a set of elements that are only in the first set"

[20d0a38f-7bb7-4c4a-ac15-90c7392ecf2b]
description = "Difference (or Complement) of a set is a set of all elements that are only in the first set -> difference removes all duplicates in the first set"

[c45aed16-5494-455a-9033-5d4c93589dc6]
description = "Union returns a set of all elements in either set -> union of empty sets is an empty set"

Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/custom-set/tests/Tests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ tests =
|> CustomSet.toList
|> List.sort
|> Expect.equalLists [ 1, 3 ]
, skip <|
test "difference removes all duplicates in the first set" <|
\() ->
CustomSet.diff (CustomSet.fromList [ 1, 1 ]) (CustomSet.fromList [ 1 ])
|> CustomSet.toList
|> Expect.equalLists []
]
, describe "A set is a subset if all of its elements are contained in the other set"
[ skip <|
Expand Down
11 changes: 11 additions & 0 deletions exercises/practice/reverse-string/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,14 @@ description = "a palindrome"

[b9e7dec1-c6df-40bd-9fa3-cd7ded010c4c]
description = "an even-sized word"

[1bed0f8a-13b0-4bd3-9d59-3d0593326fa2]
description = "wide characters"

[93d7e1b8-f60f-4f3c-9559-4056e10d2ead]
description = "grapheme cluster with pre-combined form"

[1028b2c1-6763-4459-8540-2da47ca512d9]
description = "grapheme clusters"
include = false
comment = "String.reverse cannot handle that one"
6 changes: 6 additions & 0 deletions exercises/practice/reverse-string/tests/Tests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ tests =
, skip <|
test "an even-sized word" <|
\() -> Expect.equal "reward" (reverse "drawer")
, skip <|
test "wide characters" <|
\() -> Expect.equal "猫子" (reverse "子猫")
, skip <|
test "grapheme cluster with pre-combined form" <|
\() -> Expect.equal "dnatsnehctsrüW" (reverse "Würstchenstand")
]
33 changes: 18 additions & 15 deletions exercises/practice/roman-numerals/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ description = "6 is VI"
[ff3fb08c-4917-4aab-9f4e-d663491d083d]
description = "9 is IX"

[6d1d82d5-bf3e-48af-9139-87d7165ed509]
description = "16 is XVI"

[2bda64ca-7d28-4c56-b08d-16ce65716cf6]
description = "27 is XXVII"

Expand All @@ -42,6 +45,9 @@ description = "49 is XLIX"
[d5b283d4-455d-4e68-aacf-add6c4b51915]
description = "59 is LIX"

[4465ffd5-34dc-44f3-ada5-56f5007b6dad]
description = "66 is LXVI"

[46b46e5b-24da-4180-bfe2-2ef30b39d0d0]
description = "93 is XCIII"

Expand All @@ -51,38 +57,35 @@ description = "141 is CXLI"
[267f0207-3c55-459a-b81d-67cec7a46ed9]
description = "163 is CLXIII"

[902ad132-0b4d-40e3-8597-ba5ed611dd8d]
description = "166 is CLXVI"

[cdb06885-4485-4d71-8bfb-c9d0f496b404]
description = "402 is CDII"

[6b71841d-13b2-46b4-ba97-dec28133ea80]
description = "575 is DLXXV"

[dacb84b9-ea1c-4a61-acbb-ce6b36674906]
description = "666 is DCLXVI"

[432de891-7fd6-4748-a7f6-156082eeca2f]
description = "911 is CMXI"

[e6de6d24-f668-41c0-88d7-889c0254d173]
description = "1024 is MXXIV"

[bb550038-d4eb-4be2-a9ce-f21961ac3bc6]
description = "3000 is MMM"

[6d1d82d5-bf3e-48af-9139-87d7165ed509]
description = "16 is XVI"

[4465ffd5-34dc-44f3-ada5-56f5007b6dad]
description = "66 is LXVI"

[902ad132-0b4d-40e3-8597-ba5ed611dd8d]
description = "166 is CLXVI"

[dacb84b9-ea1c-4a61-acbb-ce6b36674906]
description = "666 is DCLXVI"

[efbe1d6a-9f98-4eb5-82bc-72753e3ac328]
description = "1666 is MDCLXVI"

[bb550038-d4eb-4be2-a9ce-f21961ac3bc6]
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"
5 changes: 5 additions & 0 deletions exercises/practice/roman-numerals/tests/Tests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ tests =
\() ->
Expect.equal "MMMI"
(toRoman 3001)
, skip <|
test "3888" <|
\() ->
Expect.equal "MMMDCCCLXXXVIII"
(toRoman 3888)
, skip <|
test "3999" <|
\() ->
Expand Down

0 comments on commit ef66275

Please sign in to comment.