Просмотр исходного кода

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 лет назад
Родитель
Сommit
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