Beispiel #1
0
 def test_count_anagrams(self):
     self.assertEqual(WordListAnalyzer.count_anagrams(["dog"]), 0)
     self.assertEqual(WordListAnalyzer.count_anagrams(["dog", "Aluminum"]), 0)
     self.assertEqual(WordListAnalyzer.count_anagrams(["hat", "tah"]), 2)
     self.assertEqual(WordListAnalyzer.count_anagrams(["stone", "stone"]), 2)
     self.assertEqual(WordListAnalyzer.count_anagrams(["canyon", "CaNyON", "automobile"]), 2)
     self.assertEqual(WordListAnalyzer.count_anagrams(["Act", "cat", "cat", "dog", "dog", "aardvark"]), 5)
Beispiel #2
0
 def test_gen_tuple(self):
     self.assertEqual(WordListAnalyzer._get_word_tuple("hello"), ("e", "h", "l", "l", "o"))
     self.assertEqual(WordListAnalyzer._get_word_tuple("HELLO"), ("e", "h", "l", "l", "o"))
     self.assertEqual(WordListAnalyzer._get_word_tuple("I"), ("i",))
     self.assertEqual(WordListAnalyzer._get_word_tuple("zyxabzzht"), ("a", "b", "h", "t", "x", "y", "z", "z", "z"))