Exemplo n.º 1
0
    def test_with_different_cases(self):
        words = ["Dave Barry", "Ray Adverb"]
        anagrams = [["Dave Barry", "Ray Adverb"]]

        self.assertEqual(
            set(map(frozenset, anagrams)),
            set(map(frozenset, solution.anagrams(words))))
Exemplo n.º 2
0
    def test_with_list_of_cyrilic_anagrams(self):
        words = ['кавалер', 'акварел']
        anagrams = [['кавалер', 'акварел']]

        self.assertEqual(
            set(map(frozenset, anagrams)),
            set(map(frozenset, solution.anagrams(words))))
Exemplo n.º 3
0
    def test_with_different_symbols(self):
        words = ["Tom Marvolo Riddle", "I am Lord Voldemort",
                 "Tom Cruise", "So I'm cuter"]
        anagrams = [["Tom Marvolo Riddle", "I am Lord Voldemort"],
                    ["Tom Cruise", "So I'm cuter"]]

        self.assertEqual(
            set(map(frozenset, anagrams)),
            set(map(frozenset, solution.anagrams(words))))
Exemplo n.º 4
0
 def test_anagrams(self):
     words = [
         'army', 'mary', 'ramy', 'astronomer', 'moonstarer', 'debit card',
         'bad credit', 'bau'
     ]
     anagram_words = [['army', 'mary', 'ramy'],
                      ['bad credit', 'debit card'],
                      ['astronomer', 'moonstarer'], ['bau']]
     self.assertEqual(set(map(frozenset, anagram_words)),
                      set(map(frozenset, anagrams(words))))
Exemplo n.º 5
0
    def test_with_different_symbols(self):
        words = [
            "Tom Marvolo Riddle", "I am Lord Voldemort", "Tom Cruise",
            "So I'm cuter"
        ]
        anagrams = [["Tom Marvolo Riddle", "I am Lord Voldemort"],
                    ["Tom Cruise", "So I'm cuter"]]

        self.assertEqual(set(map(frozenset, anagrams)),
                         set(map(frozenset, solution.anagrams(words))))
Exemplo n.º 6
0
    def test_list_of_latin_anagrams(self):
        words = ['army', 'mary', 'ramy', 'astronomer', 'moonstarer',
                 'debit card', 'bad credit', 'bau']
        anagrams = [['army', 'mary', 'ramy'],
                    ['bad credit', 'debit card'],
                    ['astronomer', 'moonstarer'], ['bau']]

        self.assertEqual(
            set(map(frozenset, anagrams)),
            set(map(frozenset, solution.anagrams(words))))
Exemplo n.º 7
0
 def test_anagrams(self):
     words = ["army", "mary", "ramy", "astronomer", "moonstarer", "debit card", "bad credit", "bau"]
     anagram_words = [["army", "mary", "ramy"], ["bad credit", "debit card"], ["astronomer", "moonstarer"], ["bau"]]
     self.assertEqual(set(map(frozenset, anagram_words)), set(map(frozenset, anagrams(words))))
Exemplo n.º 8
0
    def test_with_different_cases(self):
        words = ["Dave Barry", "Ray Adverb"]
        anagrams = [["Dave Barry", "Ray Adverb"]]

        self.assertEqual(set(map(frozenset, anagrams)),
                         set(map(frozenset, solution.anagrams(words))))
Exemplo n.º 9
0
    def test_with_list_of_cyrilic_anagrams(self):
        words = ['кавалер', 'акварел']
        anagrams = [['кавалер', 'акварел']]

        self.assertEqual(set(map(frozenset, anagrams)),
                         set(map(frozenset, solution.anagrams(words))))