diff --git a/exercises/practice/anagram/.meta/tests.toml b/exercises/practice/anagram/.meta/tests.toml index 8a3708bbf..4d9056270 100644 --- a/exercises/practice/anagram/.meta/tests.toml +++ b/exercises/practice/anagram/.meta/tests.toml @@ -46,6 +46,11 @@ description = "detects anagrams using case-insensitive possible matches" [7cc195ad-e3c7-44ee-9fd2-d3c344806a2c] description = "does not detect an anagram if the original word is repeated" +include = false + +[630abb71-a94e-4715-8395-179ec1df9f91] +description = "does not detect an anagram if the original word is repeated" +reimplements = "7cc195ad-e3c7-44ee-9fd2-d3c344806a2c" [9878a1c9-d6ea-4235-ae51-3ea2befd6842] description = "anagrams must use all letters exactly once" @@ -73,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/anagram.test.ts b/exercises/practice/anagram/anagram.test.ts index 6bbbf8ee9..37829fe28 100644 --- a/exercises/practice/anagram/anagram.test.ts +++ b/exercises/practice/anagram/anagram.test.ts @@ -94,7 +94,7 @@ describe('Anagram', () => { xit('does not detect an anagram if the original word is repeated', () => { const subject = new Anagram('go') - const matches = subject.matches('go Go GO') + const matches = subject.matches('goGoGO') const expected = [] expect(areSetsEqual(new Set(expected), new Set(matches))).toEqual(true) @@ -140,6 +140,22 @@ describe('Anagram', () => { expect(areSetsEqual(new Set(expected), new Set(matches))).toEqual(true) }) + xit('handles case of greek letters', () => { + const subject = new Anagram('ΑΒΓ') + const matches = subject.matches('ΒΓΑ', 'ΒΓΔ', 'γβα', 'αβγ') + const expected = ['ΒΓΑ', 'γβα'] + + expect(areSetsEqual(new Set(expected), new Set(matches))).toEqual(true) + }) + + xit('different characters may have the same bytes', () => { + const subject = new Anagram('a⬂') + const matches = subject.matches('€a') + const expected = [] + + expect(areSetsEqual(new Set(expected), new Set(matches))).toEqual(true) + }) + xit('matches() accepts string arguments', () => { const subject = new Anagram('ant') const matches = subject.matches('stand', 'tan', 'at')