Skip to content

Commit

Permalink
anagram: Bring back unicode tests
Browse files Browse the repository at this point in the history
I removed some unicode related tests by accident in PR #1844. commit:
f03997c

When I noticed this, I upstreamed them to problem-specifications
to include them again here.
  • Loading branch information
senekor committed Jan 24, 2024
1 parent 5d4a40e commit f6d6b02
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
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"
20 changes: 20 additions & 0 deletions exercises/practice/anagram/tests/anagram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit f6d6b02

Please sign in to comment.