Skip to content

Wrong test assertion for Anagram exercise in the rust rack #2490

@ayomidebajo

Description

@ayomidebajo

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions