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

Method test_re_groupref_overflow

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

Source from the content-addressed store, hash-verified

712 re.compile(r'()(?(1)\x%02x?)' % i)
713
714 def test_re_groupref_overflow(self):
715 from re._constants import MAXGROUPS
716 self.checkTemplateError('()', r'\g<%s>' % MAXGROUPS, 'xx',
717 'invalid group reference %d' % MAXGROUPS, 3)
718 self.checkPatternError(r'(?P<a>)(?(%d))' % MAXGROUPS,
719 'invalid group reference %d' % MAXGROUPS, 10)
720
721 def test_re_groupref(self):
722 self.assertEqual(re.match(r'^(\|)?([^()]+)\1$', '|a|').groups(),

Callers

nothing calls this directly

Calls 2

checkTemplateErrorMethod · 0.95
checkPatternErrorMethod · 0.95

Tested by

no test coverage detected