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

Method test_zfill

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

Source from the content-addressed store, hash-verified

465
466 @bigmemtest(size=_2G + 20, memuse=1)
467 def test_zfill(self, size):
468 _ = self.from_latin1
469 SUBSTR = _('-568324723598234')
470 s = SUBSTR.zfill(size)
471 self.assertTrue(s.endswith(_('0') + SUBSTR[1:]))
472 self.assertTrue(s.startswith(_('-0')))
473 self.assertEqual(len(s), size)
474 self.assertEqual(s.count(_('0')), size - len(SUBSTR))
475
476 # This test is meaningful even with size < 2G, as long as the
477 # doubled string is > 2G (but it tests more if both are > 2G :)

Callers

nothing calls this directly

Calls 8

lenFunction · 0.85
assertTrueMethod · 0.80
_Function · 0.70
zfillMethod · 0.45
endswithMethod · 0.45
startswithMethod · 0.45
assertEqualMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected