File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import traceback
88from weakref import proxy
99
10+ from test .test_bigmem import character_size
11+
12+
1013# Misc tests from Tim Peters' re.doc
1114
1215# WARNING: Don't change details in these tests if you don't know
@@ -854,10 +857,17 @@ def test_compile(self):
854857 # Test behaviour when not given a string or pattern as parameter
855858 self .assertRaises (TypeError , re .compile , 0 )
856859
860+ @bigmemtest (size = _2G , memuse = character_size )
861+ def test_large_search (self , size ):
862+ # Issue #10182: indices were 32-bit-truncated.
863+ s = 'a' * size
864+ m = re .search ('$' , s )
865+ self .assertIsNotNone (m )
866+
857867 # The huge memuse is because of re.sub() using a list and a join()
858868 # to create the replacement result.
859- @bigmemtest (size = _2G , memuse = 20 )
860- def test_large (self , size ):
869+ @bigmemtest (size = _2G , memuse = 16 + 2 * character_size )
870+ def test_large_subn (self , size ):
861871 # Issue #10182: indices were 32-bit-truncated.
862872 s = 'a' * size
863873 m = re .search ('$' , s )
You can’t perform that action at this time.
0 commit comments