Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
closes #7183 - tests modifications
  • Loading branch information
wvmscs committed Feb 17, 2026
commit b741934ea8063fd9bc2b5e9072ffb6e12a3e94de
14 changes: 11 additions & 3 deletions Lib/test/test_re.py
Original file line number Diff line number Diff line change
Expand Up @@ -2537,7 +2537,8 @@ def test_possessive_quantifiers(self):
self.assertIsNone(re.match("^x{}+$", "xxx"))
self.assertTrue(re.match("^x{}+$", "x{}"))

@unittest.expectedFailure # TODO: RUSTPYTHON
# correction #7183 make it successful as in Cpython3.14
#@unittest.expectedFailure # TODO: RUSTPYTHON
Comment thread
wvmscs marked this conversation as resolved.
Outdated
def test_fullmatch_possessive_quantifiers(self):
self.assertTrue(re.fullmatch(r'a++', 'a'))
self.assertTrue(re.fullmatch(r'a*+', 'a'))
Expand Down Expand Up @@ -2565,6 +2566,11 @@ def test_fullmatch_possessive_quantifiers(self):
self.assertTrue(re.fullmatch(r'(?:ab)?+c', 'abc'))
self.assertTrue(re.fullmatch(r'(?:ab){1,3}+c', 'abc'))

# added for test of correction #7183
def test_possessive_repeat(self):
Comment thread
wvmscs marked this conversation as resolved.
Outdated
self.assertTrue(re.fullmatch("([0-9]++(?:\.[0-9]+)*+)", "1.25.38"))
self.assertEqual(re.fullmatch("([0-9]++(?:\.[0-9]+)*+)", "1.25.38").groups()[0], "1.25.38")

def test_findall_possessive_quantifiers(self):
self.assertEqual(re.findall(r'a++', 'aab'), ['aa'])
self.assertEqual(re.findall(r'a*+', 'aab'), ['aa', '', ''])
Expand All @@ -2590,7 +2596,8 @@ def test_atomic_grouping(self):
self.assertIsNone(re.match(r'(?>x)++x', 'xxx'))
self.assertIsNone(re.match(r'(?>x++)x', 'xxx'))

@unittest.expectedFailure # TODO: RUSTPYTHON
# correction #7183 make it successful as in Cpython3.14
#@unittest.expectedFailure # TODO: RUSTPYTHON
Comment thread
wvmscs marked this conversation as resolved.
Outdated
def test_fullmatch_atomic_grouping(self):
self.assertTrue(re.fullmatch(r'(?>a+)', 'a'))
self.assertTrue(re.fullmatch(r'(?>a*)', 'a'))
Expand Down Expand Up @@ -2629,7 +2636,8 @@ def test_findall_atomic_grouping(self):
self.assertEqual(re.findall(r'(?>(?:ab)?)', 'ababc'), ['ab', 'ab', '', ''])
self.assertEqual(re.findall(r'(?>(?:ab){1,3})', 'ababc'), ['abab'])

@unittest.expectedFailure # TODO: RUSTPYTHON
# correction #7183 make it success as in Cpython3.14
#@unittest.expectedFailure # TODO: RUSTPYTHON
Comment thread
wvmscs marked this conversation as resolved.
Outdated
def test_bug_gh91616(self):
self.assertTrue(re.fullmatch(r'(?s:(?>.*?\.).*)\z', "a.txt")) # reproducer
self.assertTrue(re.fullmatch(r'(?s:(?=(?P<g0>.*?\.))(?P=g0).*)\z', "a.txt"))
Expand Down