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

Method test_bug_725106

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

Source from the content-addressed store, hash-verified

1679 ('a:', 'a'))
1680
1681 def test_bug_725106(self):
1682 # capturing groups in alternatives in repeats
1683 self.assertEqual(re.match('^((a)|b)*', 'abc').groups(),
1684 ('b', 'a'))
1685 self.assertEqual(re.match('^(([ab])|c)*', 'abc').groups(),
1686 ('c', 'b'))
1687 self.assertEqual(re.match('^((d)|[ab])*', 'abc').groups(),
1688 ('b', None))
1689 self.assertEqual(re.match('^((a)c|[ab])*', 'abc').groups(),
1690 ('b', None))
1691 self.assertEqual(re.match('^((a)|b)*?c', 'abc').groups(),
1692 ('b', 'a'))
1693 self.assertEqual(re.match('^(([ab])|c)*?d', 'abcd').groups(),
1694 ('c', 'b'))
1695 self.assertEqual(re.match('^((d)|[ab])*?c', 'abc').groups(),
1696 ('b', None))
1697 self.assertEqual(re.match('^((a)c|[ab])*?c', 'abc').groups(),
1698 ('b', None))
1699
1700 def test_bug_725149(self):
1701 # mark_stack_base restoring before restoring marks

Callers

nothing calls this directly

Calls 3

assertEqualMethod · 0.45
groupsMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected