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

Method test_bug_418626

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

Source from the content-addressed store, hash-verified

1580 self.assertEqual(re.match(r"((a))", "a").lastindex, 1)
1581
1582 def test_bug_418626(self):
1583 # bugs 418626 at al. -- Testing Greg Chapman's addition of op code
1584 # SRE_OP_MIN_REPEAT_ONE for eliminating recursion on simple uses of
1585 # pattern '*?' on a long string.
1586 self.assertEqual(re.match('.*?c', 10000*'ab'+'cd').end(0), 20001)
1587 self.assertEqual(re.match('.*?cd', 5000*'ab'+'c'+5000*'ab'+'cde').end(0),
1588 20003)
1589 self.assertEqual(re.match('.*?cd', 20000*'abc'+'de').end(0), 60001)
1590 # non-simple '*?' still used to hit the recursion limit, before the
1591 # non-recursive scheme was implemented.
1592 self.assertEqual(re.search('(a|b)*?c', 10000*'ab'+'cd').end(0), 20001)
1593
1594 def test_bug_612074(self):
1595 pat="["+re.escape("\u2039")+"]"

Callers

nothing calls this directly

Calls 4

assertEqualMethod · 0.45
endMethod · 0.45
matchMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected