diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-08-03 16:18:38 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-08-03 16:18:38 (GMT) |
commit | 1f35ae0a3c7dc2d7709f60e62cb4d0aa7aeae490 (patch) | |
tree | da53139331ad9a0e3b0c059815c195f835da4b2d /Lib/test/test_re.py | |
parent | 1dfb9180a736c9033730ce05db696ee32c5a3d1c (diff) | |
download | cpython-1f35ae0a3c7dc2d7709f60e62cb4d0aa7aeae490.zip cpython-1f35ae0a3c7dc2d7709f60e62cb4d0aa7aeae490.tar.gz cpython-1f35ae0a3c7dc2d7709f60e62cb4d0aa7aeae490.tar.bz2 |
Issue #17998: Fix an internal error in regular expression engine.
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r-- | Lib/test/test_re.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 8bc74a2..c84d4ed 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -1040,6 +1040,16 @@ class ReTests(unittest.TestCase): with self.assertRaisesRegex(sre_constants.error, '\?foo'): re.compile('(?P<?foo>)') + def test_issue17998(self): + for reps in '*', '+', '?', '{1}': + for mod in '', '?': + pattern = '.' + reps + mod + 'yz' + self.assertEqual(re.compile(pattern, re.S).findall('xyz'), + ['xyz'], msg=pattern) + pattern = pattern.encode() + self.assertEqual(re.compile(pattern, re.S).findall(b'xyz'), + [b'xyz'], msg=pattern) + def run_re_tests(): from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR |