MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_rstrip

Method test_rstrip

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 8

lenFunction · 0.85
isinstanceFunction · 0.85
assertTrueMethod · 0.80
_Function · 0.70
ljustMethod · 0.45
assertEqualMethod · 0.45
rstripMethod · 0.45
rjustMethod · 0.45

Tested by

no test coverage detected