summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-12-03 19:55:56 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-12-03 19:55:56 (GMT)
commitb33941ab02e47bffffdcb32b2ec4cc44654540bd (patch)
tree7a2c90bab3081b0826e8e372b85f9706ccf60c8c /Lib
parente8544336864736ae1ecd67fb8ec07de42f3f7149 (diff)
parent1f1888ec1e7c7d4e69084cda9425cf0a456e30c3 (diff)
downloadcpython-b33941ab02e47bffffdcb32b2ec4cc44654540bd.zip
cpython-b33941ab02e47bffffdcb32b2ec4cc44654540bd.tar.gz
cpython-b33941ab02e47bffffdcb32b2ec4cc44654540bd.tar.bz2
Split the bigmem re test in two separate tests with different memory requirements.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_re.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 82179b7..28944b1 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -949,10 +949,17 @@ class ReTests(unittest.TestCase):
# Test behaviour when not given a string or pattern as parameter
self.assertRaises(TypeError, re.compile, 0)
+ @bigmemtest(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.
- @bigmemtest(size=_2G, memuse=20)
- def test_large(self, size):
+ @bigmemtest(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)