Преглед изворни кода

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 година
родитељ
комит
a4c9c26d5f
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1
    1
      anagram/src/test/java/AnagramTest.java

+ 1
- 1
anagram/src/test/java/AnagramTest.java Прегледај датотеку

@@ -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