summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-12-03 19:53:12 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-12-03 19:53:12 (GMT)
commit735f36edb8cc7ce46e5eb17319e77bc2bade3516 (patch)
treedc7d7132de6de683c1c239ead5fc51af471a854f /Lib/test
parentd5f462bbc409a5ce89ad3e1d6045d2d11aae7378 (diff)
downloadcpython-735f36edb8cc7ce46e5eb17319e77bc2bade3516.zip
cpython-735f36edb8cc7ce46e5eb17319e77bc2bade3516.tar.gz
cpython-735f36edb8cc7ce46e5eb17319e77bc2bade3516.tar.bz2
Split the bigmem re test in two separate tests with different memory requirements.
Diffstat (limited to 'Lib/test')
-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 befe0e8..f01fb96 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -7,6 +7,7 @@ import string
import traceback
from weakref import proxy
+
# Misc tests from Tim Peters' re.doc
# WARNING: Don't change details in these tests if you don't know
@@ -820,10 +821,17 @@ class ReTests(unittest.TestCase):
# Test behaviour when not given a string or pattern as parameter
self.assertRaises(TypeError, re.compile, 0)
+ @precisionbigmemtest(size=_2G, memuse=1)
+ def test_large_search(self, size):
+ # Issue #10182: indices were 32-bit-truncated.
+ s = 'a' * size
+ m = re.search('$', s)
+ self.assertIsNotNone(m)
+
# The huge memuse is because of re.sub() using a list and a join()
# to create the replacement result.
- @precisionbigmemtest(size=_2G, memuse=20)
- def test_large(self, size):
+ @precisionbigmemtest(size=_2G, memuse=16 + 2)
+ def test_large_subn(self, size):
# Issue #10182: indices were 32-bit-truncated.
s = 'a' * size
m = re.search('$', s)