MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_bug_725106

Method test_bug_725106

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

Source from the content-addressed store, hash-verified

1655 ('a:', 'a'))
1656
1657 def test_bug_725106(self):
1658 # capturing groups in alternatives in repeats
1659 self.assertEqual(re.match('^((a)|b)*', 'abc').groups(),
1660 ('b', 'a'))
1661 self.assertEqual(re.match('^(([ab])|c)*', 'abc').groups(),
1662 ('c', 'b'))
1663 self.assertEqual(re.match('^((d)|[ab])*', 'abc').groups(),
1664 ('b', None))
1665 self.assertEqual(re.match('^((a)c|[ab])*', 'abc').groups(),
1666 ('b', None))
1667 self.assertEqual(re.match('^((a)|b)*?c', 'abc').groups(),
1668 ('b', 'a'))
1669 self.assertEqual(re.match('^(([ab])|c)*?d', 'abcd').groups(),
1670 ('c', 'b'))
1671 self.assertEqual(re.match('^((d)|[ab])*?c', 'abc').groups(),
1672 ('b', None))
1673 self.assertEqual(re.match('^((a)c|[ab])*?c', 'abc').groups(),
1674 ('b', None))
1675
1676 def test_bug_725149(self):
1677 # 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