-
-
Notifications
You must be signed in to change notification settings - Fork 30
Sync anagram tests with problem specifications #539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,11 +17,11 @@ Public Class AnagramTest | |||||
| Assert.Equal(expected, result) | ||||||
| End Sub | ||||||
|
|
||||||
| <Fact(Skip:="Remove this Skip property to run this test")> | ||||||
| <Fact> | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Only the first test in the entire suite should be unskipped. Every subsequent test is skipped so the student ideally unskips them one at a time. |
||||||
| Public Sub DetectMultipleAnagrams() | ||||||
| Dim detector = New Anagram("master") | ||||||
| Dim words = {"stream", "pigeon", "maters"} | ||||||
| Dim expected = {"maters", "stream"} | ||||||
| Dim detector = New Anagram("solemn") | ||||||
| Dim words = {"lemons", "cherry", "melons"} | ||||||
| Dim expected = {"lemons", "melons"} | ||||||
| Dim result as IEnumerable(Of String) = detector.Match(words) | ||||||
| Assert.Equal(expected, result) | ||||||
| End Sub | ||||||
|
|
@@ -35,6 +35,42 @@ Public Class AnagramTest | |||||
| Assert.Equal(expected, result) | ||||||
| End Sub | ||||||
|
|
||||||
| <Fact(Skip:="Remove this Skip property to run this test")> | ||||||
| Public Sub OriginalWordRepeated() | ||||||
| Dim detector = New Anagram("go") | ||||||
| Dim words = {"goGoGO"} | ||||||
| Dim expected = Array.Empty(Of String)() | ||||||
| Dim result as IEnumerable(Of String) = detector.Match(words) | ||||||
| Assert.Equal(expected, result) | ||||||
| End Sub | ||||||
|
|
||||||
| <Fact(Skip:="Remove this Skip property to run this test")> | ||||||
| Public Sub BananaIsNotAnagramOfItself() | ||||||
| Dim detector = New Anagram("BANANA") | ||||||
| Dim words = {"BANANA"} | ||||||
| Dim expected = Array.Empty(Of String)() | ||||||
| Dim result as IEnumerable(Of String) = detector.Match(words) | ||||||
| Assert.Equal(expected, result) | ||||||
| End Sub | ||||||
|
|
||||||
| <Fact(Skip:="Remove this Skip property to run this test")> | ||||||
| Public Sub BananaDifferentCaseIsNotAnagram() | ||||||
| Dim detector = New Anagram("BANANA") | ||||||
| Dim words = {"Banana"} | ||||||
| Dim expected = Array.Empty(Of String)() | ||||||
| Dim result as IEnumerable(Of String) = detector.Match(words) | ||||||
| Assert.Equal(expected, result) | ||||||
| End Sub | ||||||
|
|
||||||
| <Fact(Skip:="Remove this Skip property to run this test")> | ||||||
| Public Sub BananaCompletelyDifferentCaseIsNotAnagram() | ||||||
| Dim detector = New Anagram("BANANA") | ||||||
| Dim words = {"banana"} | ||||||
| Dim expected = Array.Empty(Of String)() | ||||||
| Dim result as IEnumerable(Of String) = detector.Match(words) | ||||||
| Assert.Equal(expected, result) | ||||||
| End Sub | ||||||
|
|
||||||
| <Fact(Skip:="Remove this Skip property to run this test")> | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test isn't in the problem specifications and should be removed. |
||||||
| Public Sub IdenticalWordIsNotAnagram() | ||||||
| Dim detector = New Anagram("corn") | ||||||
|
|
@@ -81,4 +117,31 @@ Public Class AnagramTest | |||||
| Assert.Equal(expected, result) | ||||||
| End Sub | ||||||
|
|
||||||
| <Fact(Skip:="Remove this Skip property to run this test")> | ||||||
| Public Sub ListenHasSilentAsAnagram() | ||||||
| Dim detector = New Anagram("LISTEN") | ||||||
| Dim words = {"LISTEN", "Silent"} | ||||||
| Dim expected = {"Silent"} | ||||||
| Dim result as IEnumerable(Of String) = detector.Match(words) | ||||||
| Assert.Equal(expected, result) | ||||||
| End Sub | ||||||
|
|
||||||
| <Fact(Skip:="Remove this Skip property to run this test")> | ||||||
| Public Sub GreekLettersAreHandledCaseInsensitively() | ||||||
| Dim detector = New Anagram("ΑΒΓ") | ||||||
| Dim words = {"ΒΓΑ", "ΒΓΔ", "γβα", "αβγ"} | ||||||
| Dim expected = {"ΒΓΑ", "γβα"} | ||||||
| Dim result as IEnumerable(Of String) = detector.Match(words) | ||||||
| Assert.Equal(expected, result) | ||||||
| End Sub | ||||||
|
|
||||||
| <Fact(Skip:="Remove this Skip property to run this test")> | ||||||
| Public Sub DifferentCharactersWithSameBytesAreNotAnagrams() | ||||||
| Dim detector = New Anagram("a⬂") | ||||||
| Dim words = {"€a"} | ||||||
| Dim expected = Array.Empty(Of String)() | ||||||
| Dim result as IEnumerable(Of String) = detector.Match(words) | ||||||
| Assert.Equal(expected, result) | ||||||
| End Sub | ||||||
|
|
||||||
| End Class | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the tests here need to be resorted so the order that's in the
tests.toml. That'll make it easier to spot things that aren't canonical.