Ejemplo n.º 1
0
 def test_pmatch_000(self):
     """First Test run."""
     string1 = "aaaapies- -applxe pies available"
     string2 = "aaaacome have some apple .pies"
     results = _pmatches(string1, string2)
     logging.info(_pmatches.cache_info())
     assert results == {"aaaa", "pies", "appl"}
Ejemplo n.º 2
0
 def test_matches_none(self):
     strings = [
         "aa",
         "ba",
         "bc",
         "dd",
         "ae",
     ]
     results = matches(strings)
     logging.info(_pmatches.cache_info())
     assert not any(results)
Ejemplo n.º 3
0
 def test_matches_single_match(self):
     strings = [
         "aac",
         "aac",
         "aac",
         "aad",
         "ealaad",
     ]
     results = matches(strings)
     logging.info(_pmatches.cache_info())
     assert list(results) == [
         "aa",
     ]
Ejemplo n.º 4
0
 def test_matches_duplicate_str(self):
     string1 = "aaaapies- -applxe pies available"
     string2 = "aaaacome have some apple .pies"
     strings = [
         string1,
         string2,
         string1,
         string2,
         string1,
     ]
     results = matches(strings)
     logging.info(_pmatches.cache_info())
     assert list(results) == ["aaaa", "appl", "pies"]
Ejemplo n.º 5
0
 def test_matches_single_letter(self):
     strings = [
         "ab",
         "b",
         "bbc",
         "bc",
         "dbd",
         "bbae",
     ]
     results = matches(strings)
     logging.info(_pmatches.cache_info())
     assert list(results) == [
         "b",
     ]