Пример #1
0
    def test_same_word_isnt_anagram(self):
        self.assertEqual(
            [],
            detect_anagrams('banana', ['banana'])
        )

        self.assertEqual(
            [],
            detect_anagrams('go', 'go Go GO'.split())
        )
Пример #2
0
 def test_multiple_anagrams(self):
     self.assertEqual(
         'gallery regally largely'.split(),
         detect_anagrams(
             'allergy',
             'gallery ballerina regally clergy largely leading'.split()
         )
     )
Пример #3
0
 def test_no_matches(self):
     self.assertEqual(
         [],
         detect_anagrams('diaper', 'hello world zombies pants'.split())
     )
Пример #4
0
 def test_anagrams_are_case_insensitive(self):
     self.assertEqual(
         ['Carthorse'],
         detect_anagrams('Orchestra',
                         'cashregister Carthorse radishes'.split())
     )
Пример #5
0
 def test_detect_anagram(self):
     self.assertEqual(
         ['inlets'],
         detect_anagrams('listen', 'enlists google inlets banana'.split())
     )
Пример #6
0
 def test_eliminate_anagram_subsets(self):
     self.assertEqual(
         [],
         detect_anagrams('good', 'dog goody'.split())
     )
Пример #7
0
 def test_does_not_confuse_different_duplicates(self):
     self.assertEqual(
         [],
         detect_anagrams('galea', ['eagle'])
     )
Пример #8
0
 def test_detect_multiple_anagrams(self):
     self.assertEqual(
         ['stream', 'maters'],
         detect_anagrams('master', 'stream pigeon maters'.split())
     )
Пример #9
0
 def test_detect_simple_anagram(self):
     self.assertEqual(
         ['tan'],
         detect_anagrams('ant', 'tan stand at'.split())
     )