-
-
Notifications
You must be signed in to change notification settings - Fork 557
Closed
Description
It seems one of the test assertions is wrong i.e. handles_case_of_greek_letters().
In the test, we have this code block
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);
}
when you convert the possible anagrams to lowercase you have the following.
['α', 'β', 'γ'] ['β', 'γ', 'δ'] ['α', 'β', 'γ'] ['α', 'β', 'γ']
please note that the word is 'α', 'β', 'γ' (when sorted && converted to lowercase).
This means the expected HashSet should be ["ΒΓΑ", "γβα", "αβγ"] not ["ΒΓΑ", "γβα"].
Metadata
Metadata
Assignees
Labels
No labels