summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-11-20 21:30:42 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-11-20 21:30:42 (GMT)
commitb83ea144ccf39e2c9346d3a53cf67e154d29b4cb (patch)
treedcfd2b0d27c9c07254ed4449d4be6605e55586ea /Lib/test/test_re.py
parente78f12f7c29d0ac48b5fee86b9afb38012a809e5 (diff)
downloadcpython-b83ea144ccf39e2c9346d3a53cf67e154d29b4cb.zip
cpython-b83ea144ccf39e2c9346d3a53cf67e154d29b4cb.tar.gz
cpython-b83ea144ccf39e2c9346d3a53cf67e154d29b4cb.tar.bz2
Issue #1160: Fix compiling large regular expressions on UCS2 builds.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r--Lib/test/test_re.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 0bceaa2..ff2c953 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -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")