Ejemplo n.º 1
0
 def test_complex(self):
     words = ["BAK", "BAR", "RYBAK", "ŻABA", "JAREK"]
     matched_words = match_words(words, ["R", "K", "Y", "_", "A"],
                                 ["A", "B"])
     self.assertEqual(["BAK", "BAR", "RYBAK", "ŻABA"], matched_words)
Ejemplo n.º 2
0
 def test_polish_letters(self):
     matched_words = match_words(["AA", "AŻ", "AD"], ["A", "B", "D", "Ż"],
                                 ["A"])
     self.assertIsInstance(matched_words, list)
     self.assertEqual(["AA", "AŻ", "AD"], matched_words)
Ejemplo n.º 3
0
 def test_two_blanks(self):
     words = ["BAK", "BAR"]
     matched_words = match_words(words, ["O", "_", "_"], ["B"])
     self.assertEqual(words, matched_words)
Ejemplo n.º 4
0
 def test_more_letters(self):
     words = ["BAK", "BAR", "RYBAK", "ŻABA"]
     matched_words = match_words(words, ["R", "K", "Y", "Ż", "A"],
                                 ["A", "B"])
     self.assertEqual(words, matched_words)
Ejemplo n.º 5
0
 def test_no_match(self):
     words = ["AB", "AA"]
     matched_words = match_words(words, ["K", "J"], ["A"])
     self.assertEqual([], matched_words)
Ejemplo n.º 6
0
 def test_simplest_double_match(self):
     words = ["AB", "AA"]
     matched_words = match_words(words, ["A", "B"], ["A"])
     self.assertEqual(words, matched_words)
Ejemplo n.º 7
0
 def test_simplest_match(self):
     matched_words = match_words(["AA"], ["A", "B"], ["A"])
     self.assertIsInstance(matched_words, list)
     self.assertEqual(["AA"], matched_words)