MCPcopy Index your code
hub / github.com/clips/pattern / test_match

Method test_match

test/test_search.py:17–27  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

15 pass
16
17 def test_match(self):
18 # Assert search._match() wildcard matching.
19 for s, p, b in (
20 ("rabbit", "rabbit", True),
21 ("rabbits", "rabbit*", True),
22 ("rabbits", "*abbits", True),
23 ("rabbits", "*abbit*", True),
24 ("rabbits", "rab*its", True),
25 ("rabbits", re.compile(r"ra.*?"), True)):
26 self.assertEqual(search._match(s, p), b)
27 print "pattern.search._match()"
28
29 def test_unique(self):
30 self.assertEqual(search.unique([1,1,2,2]), [1,2])

Callers

nothing calls this directly

Calls 1

_matchMethod · 0.80

Tested by

no test coverage detected