From f6d6b02dac64e57f24799ca0a89f92437193b080 Mon Sep 17 00:00:00 2001 From: Remo Senekowitsch Date: Wed, 24 Jan 2024 12:40:24 +0100 Subject: [PATCH] anagram: Bring back unicode tests I removed some unicode related tests by accident in PR #1844. commit: f03997cd1fe10ebce11f4dc16504f65628fb30fd When I noticed this, I upstreamed them to problem-specifications to include them again here. --- exercises/practice/anagram/.meta/tests.toml | 6 ++++++ exercises/practice/anagram/tests/anagram.rs | 20 ++++++++++++++++++++ problem-specifications | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/exercises/practice/anagram/.meta/tests.toml b/exercises/practice/anagram/.meta/tests.toml index 4f43811d2..4d9056270 100644 --- a/exercises/practice/anagram/.meta/tests.toml +++ b/exercises/practice/anagram/.meta/tests.toml @@ -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" diff --git a/exercises/practice/anagram/tests/anagram.rs b/exercises/practice/anagram/tests/anagram.rs index 44cab71a0..5814f693e 100644 --- a/exercises/practice/anagram/tests/anagram.rs +++ b/exercises/practice/anagram/tests/anagram.rs @@ -166,3 +166,23 @@ fn words_other_than_themselves_can_be_anagrams() { let expected = HashSet::from_iter(["Silent"]); assert_eq!(output, expected); } + +#[test] +#[ignore] +fn handles_case_of_greek_letters() { + let word = "ΑΒΓ"; + let inputs = &["ΒΓΑ", "ΒΓΔ", "γβα", "αβγ"]; + let output = anagrams_for(word, inputs); + let expected = HashSet::from_iter(["ΒΓΑ", "γβα"]); + assert_eq!(output, expected); +} + +#[test] +#[ignore] +fn different_characters_may_have_the_same_bytes() { + let word = "a⬂"; + let inputs = &["€a"]; + let output = anagrams_for(word, inputs); + let expected = HashSet::from_iter([]); + assert_eq!(output, expected); +} diff --git a/problem-specifications b/problem-specifications index 1904c9bb0..524e2b3e1 160000 --- a/problem-specifications +++ b/problem-specifications @@ -1 +1 @@ -Subproject commit 1904c9bb0ff2465d269744601d8ab84cc941c767 +Subproject commit 524e2b3e186a5a307cd55d974e3c71796a947ebd