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

Method test_MIN_UNTIL_mark_bug

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

Source from the content-addressed store, hash-verified

2414 self.assertEqual(re.match(r'(.b|a)*?b', 'ab').groups(), ('a',))
2415
2416 def test_MIN_UNTIL_mark_bug(self):
2417 # Fixed in issue35859, reported in issue9134.
2418 # JUMP_MIN_UNTIL_2 should MARK_PUSH() if in a repeat
2419 s = 'axxzbcz'
2420 p = r'(?:(?:a|bc)*?(xx)??z)*'
2421 self.assertEqual(re.match(p, s).groups(), ('xx',))
2422
2423 # test-case provided by issue9134
2424 s = 'xtcxyzxc'
2425 p = r'((x|yz)+?(t)??c)*'
2426 m = re.match(p, s)
2427 self.assertEqual(m.span(), (0, 8))
2428 self.assertEqual(m.span(2), (6, 7))
2429 self.assertEqual(m.groups(), ('xyzxc', 'x', 't'))
2430
2431 def test_REPEAT_ONE_mark_bug(self):
2432 # issue35859

Callers

nothing calls this directly

Calls 4

spanMethod · 0.80
assertEqualMethod · 0.45
groupsMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected