summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r--Lib/test/test_re.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 85541f4..5a5de52 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -2366,6 +2366,16 @@ class ReTests(unittest.TestCase):
self.assertFalse(template_re1.match('nope'))
def test_bug_gh106052(self):
+ # gh-100061
+ self.assertEqual(re.match('(?>(?:.(?!D))+)', 'ABCDE').span(), (0, 2))
+ self.assertEqual(re.match('(?:.(?!D))++', 'ABCDE').span(), (0, 2))
+ self.assertEqual(re.match('(?>(?:.(?!D))*)', 'ABCDE').span(), (0, 2))
+ self.assertEqual(re.match('(?:.(?!D))*+', 'ABCDE').span(), (0, 2))
+ self.assertEqual(re.match('(?>(?:.(?!D))?)', 'CDE').span(), (0, 0))
+ self.assertEqual(re.match('(?:.(?!D))?+', 'CDE').span(), (0, 0))
+ self.assertEqual(re.match('(?>(?:.(?!D)){1,3})', 'ABCDE').span(), (0, 2))
+ self.assertEqual(re.match('(?:.(?!D)){1,3}+', 'ABCDE').span(), (0, 2))
+ # gh-106052
self.assertEqual(re.match("(?>(?:ab?c)+)", "aca").span(), (0, 2))
self.assertEqual(re.match("(?:ab?c)++", "aca").span(), (0, 2))
self.assertEqual(re.match("(?>(?:ab?c)*)", "aca").span(), (0, 2))
@@ -2471,7 +2481,6 @@ ATOMIC_GROUP
17: SUCCESS
''')
- @unittest.expectedFailure # gh-106052
def test_possesive_repeat_one(self):
self.assertEqual(get_debug_out(r'a?+'), '''\
POSSESSIVE_REPEAT 0 1
@@ -2484,7 +2493,6 @@ POSSESSIVE_REPEAT 0 1
12: SUCCESS
''')
- @unittest.expectedFailure # gh-106052
def test_possesive_repeat(self):
self.assertEqual(get_debug_out(r'(?:ab)?+'), '''\
POSSESSIVE_REPEAT 0 1