Commit 735f36ed authored by Antoine Pitrou's avatar Antoine Pitrou

Split the bigmem re test in two separate tests with different memory requirements.

parent d5f462bb
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment