Bladeren bron

anagram: Clarify expectations about identical words

An anagram is defined as

1. the same letters
2. rearranged
3. to make a new word

The existing assertion only checked the presence of the expected word,
but did not explicitly exclude the existence of results that match the
input exactly.
John Michael Luy 11 jaren geleden
bovenliggende
commit
a4c9c26d5f
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1
    1
      anagram/src/test/java/AnagramTest.java

+ 1
- 1
anagram/src/test/java/AnagramTest.java Bestand weergeven

@@ -38,7 +38,7 @@ public class AnagramTest {
38 38
     public void testIdenticalWordIsNotAnagram() {
39 39
         Anagram detector = new Anagram("corn");
40 40
         List<String> anagrams = detector.match(Arrays.asList("corn", "dark", "Corn", "rank", "CORN", "cron", "park"));
41
-        assertThat(anagrams, hasItems("cron"));
41
+        assertEquals(anagrams, Arrays.asList("cron"));
42 42
     }
43 43
 
44 44
     @Test