MCPcopy Index your code
hub / github.com/python/cpython / test_rstrip

Method test_rstrip

Lib/test/test_bigmem.py:334–346  ·  view source on GitHub ↗
(self, size)

Source from the content-addressed store, hash-verified

332
333 @bigmemtest(size=_2G + 10, memuse=1)
334 def test_rstrip(self, size):
335 _ = self.from_latin1
336 SUBSTR = _(' abc def ghi')
337 s = SUBSTR.ljust(size)
338 self.assertEqual(len(s), size)
339 self.assertEqual(s.rstrip(), SUBSTR.rstrip())
340 del s
341 s = SUBSTR.rjust(size)
342 self.assertEqual(len(s), size)
343 # Type-specific optimization
344 if isinstance(s, (str, bytes)):
345 stripped = s.rstrip()
346 self.assertTrue(stripped is s)
347
348 # The test takes about size bytes to build a string, and then about
349 # sqrt(size) substrings of sqrt(size) in size and a list to

Callers

nothing calls this directly

Calls 6

assertTrueMethod · 0.80
_Function · 0.70
ljustMethod · 0.45
assertEqualMethod · 0.45
rstripMethod · 0.45
rjustMethod · 0.45

Tested by

no test coverage detected