mirror of
https://github.com/python/cpython.git
synced 2025-09-01 14:38:00 +00:00
Fix test_splitlines to reach its size estimate
This commit is contained in:
parent
f81ad6fa5a
commit
a5d9917d21
1 changed files with 2 additions and 2 deletions
|
@ -393,9 +393,9 @@ class BaseStrTest:
|
||||||
# take up an inordinate amount of memory
|
# take up an inordinate amount of memory
|
||||||
chunksize = int(size ** 0.5 + 2) // 2
|
chunksize = int(size ** 0.5 + 2) // 2
|
||||||
SUBSTR = _(' ') * chunksize + _('\n') + _(' ') * chunksize + _('\r\n')
|
SUBSTR = _(' ') * chunksize + _('\n') + _(' ') * chunksize + _('\r\n')
|
||||||
s = SUBSTR * chunksize
|
s = SUBSTR * (chunksize * 2)
|
||||||
l = s.splitlines()
|
l = s.splitlines()
|
||||||
self.assertEqual(len(l), chunksize * 2)
|
self.assertEqual(len(l), chunksize * 4)
|
||||||
expected = _(' ') * chunksize
|
expected = _(' ') * chunksize
|
||||||
for item in l:
|
for item in l:
|
||||||
self.assertEqual(item, expected)
|
self.assertEqual(item, expected)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue