mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #1160: Fix compiling large regular expressions on UCS2 builds.
Patch by Serhiy Storchaka.
This commit is contained in:
parent
e78f12f7c2
commit
b83ea144cc
4 changed files with 17 additions and 9 deletions
|
@ -425,6 +425,12 @@ class ReTests(unittest.TestCase):
|
|||
self.assertEqual(re.match(u"([\u2222\u2223])",
|
||||
u"\u2222", re.UNICODE).group(1), u"\u2222")
|
||||
|
||||
def test_big_codesize(self):
|
||||
# Issue #1160
|
||||
r = re.compile('|'.join(('%d'%x for x in range(10000))))
|
||||
self.assertIsNotNone(r.match('1000'))
|
||||
self.assertIsNotNone(r.match('9999'))
|
||||
|
||||
def test_anyall(self):
|
||||
self.assertEqual(re.match("a.b", "a\nb", re.DOTALL).group(0),
|
||||
"a\nb")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue