MCPcopy Index your code
hub / github.com/python/cpython / test_expand

Method test_expand

Lib/test/test_re.py:740–748  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

738 {'first':'first', 'second':'second'})
739
740 def test_expand(self):
741 self.assertEqual(re.match("(?P<first>first) (?P<second>second)",
742 "first second")
743 .expand(r"\2 \1 \g<second> \g<first>"),
744 "second first second first")
745 self.assertEqual(re.match("(?P<first>first)|(?P<second>second)",
746 "first")
747 .expand(r"\2 \g<second>"),
748 " ")
749
750 def test_repeat_minmax(self):
751 self.assertIsNone(re.match(r"^(\w){1}$", "abc"))

Callers

nothing calls this directly

Calls 3

assertEqualMethod · 0.45
expandMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected