From 39bdad813a2f07bd8c373e2c88b76467ef12832c Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Tue, 20 Nov 2012 22:30:42 +0100 Subject: Issue #1160: Fix compiling large regular expressions on UCS2 builds. Patch by Serhiy Storchaka. --- Lib/test/test_re.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Lib/test') diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 5162d4e6d8..39972d51e8 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -419,6 +419,12 @@ class ReTests(unittest.TestCase): self.assertEqual(re.match("([\u2222\u2223])", "\u2222", re.UNICODE).group(1), "\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") -- cgit v1.2.1