Skip to content

Commit e8250ab

Browse files
authored
Sync anagram tests (#1626)
1 parent 661e141 commit e8250ab

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

exercises/practice/anagram/.meta/tests.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ description = "detects anagrams using case-insensitive possible matches"
4646

4747
[7cc195ad-e3c7-44ee-9fd2-d3c344806a2c]
4848
description = "does not detect an anagram if the original word is repeated"
49+
include = false
50+
51+
[630abb71-a94e-4715-8395-179ec1df9f91]
52+
description = "does not detect an anagram if the original word is repeated"
53+
reimplements = "7cc195ad-e3c7-44ee-9fd2-d3c344806a2c"
4954

5055
[9878a1c9-d6ea-4235-ae51-3ea2befd6842]
5156
description = "anagrams must use all letters exactly once"
@@ -73,3 +78,9 @@ include = false
7378
[33d3f67e-fbb9-49d3-a90e-0beb00861da7]
7479
description = "words other than themselves can be anagrams"
7580
reimplements = "a0705568-628c-4b55-9798-82e4acde51ca"
81+
82+
[a6854f66-eec1-4afd-a137-62ef2870c051]
83+
description = "handles case of greek letters"
84+
85+
[fd3509e5-e3ba-409d-ac3d-a9ac84d13296]
86+
description = "different characters may have the same bytes"

exercises/practice/anagram/anagram.test.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('Anagram', () => {
9494

9595
xit('does not detect an anagram if the original word is repeated', () => {
9696
const subject = new Anagram('go')
97-
const matches = subject.matches('go Go GO')
97+
const matches = subject.matches('goGoGO')
9898
const expected = []
9999

100100
expect(areSetsEqual(new Set(expected), new Set(matches))).toEqual(true)
@@ -140,6 +140,22 @@ describe('Anagram', () => {
140140
expect(areSetsEqual(new Set(expected), new Set(matches))).toEqual(true)
141141
})
142142

143+
xit('handles case of greek letters', () => {
144+
const subject = new Anagram('ΑΒΓ')
145+
const matches = subject.matches('ΒΓΑ', 'ΒΓΔ', 'γβα', 'αβγ')
146+
const expected = ['ΒΓΑ', 'γβα']
147+
148+
expect(areSetsEqual(new Set(expected), new Set(matches))).toEqual(true)
149+
})
150+
151+
xit('different characters may have the same bytes', () => {
152+
const subject = new Anagram('a⬂')
153+
const matches = subject.matches('€a')
154+
const expected = []
155+
156+
expect(areSetsEqual(new Set(expected), new Set(matches))).toEqual(true)
157+
})
158+
143159
xit('matches() accepts string arguments', () => {
144160
const subject = new Anagram('ant')
145161
const matches = subject.matches('stand', 'tan', 'at')

0 commit comments

Comments
 (0)