summaryrefslogtreecommitdiffstats
path: root/Lib
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)
commit1f1888ec1e7c7d4e69084cda9425cf0a456e30c3 (patch)
tree528dc46054604f90dbd8b1cdb6f4635e7b255897 /Lib
parenteb0abce2f8d65c097124d05a4f79b6acd6391fa1 (diff)
downloadcpython-1f1888ec1e7c7d4e69084cda9425cf0a456e30c3.zip
cpython-1f1888ec1e7c7d4e69084cda9425cf0a456e30c3.tar.gz
cpython-1f1888ec1e7c7d4e69084cda9425cf0a456e30c3.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.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 438ef26..96a6bce 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -7,6 +7,9 @@ import string
import traceback
from weakref import proxy
+from test.test_bigmem import character_size
+
+
# Misc tests from Tim Peters' re.doc
# WARNING: Don't change details in these tests if you don't know
@@ -854,10 +857,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=character_size)
+ 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 * character_size)
+ def test_large_subn(self, size):
# Issue #10182: indices were 32-bit-truncated.
s = 'a' * size
m = re.search('$', s)