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

Method test_replace_overflow

Lib/test/string_tests.py:838–843  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

836 @unittest.skipIf(sys.maxsize > (1 << 32) or struct.calcsize('P') != 4,
837 'only applies to 32-bit platforms')
838 def test_replace_overflow(self):
839 # Check for overflow checking on 32 bit machines
840 A2_16 = "A" * (2**16)
841 self.checkraises(OverflowError, A2_16, "replace", "", A2_16)
842 self.checkraises(OverflowError, A2_16, "replace", "A", A2_16)
843 self.checkraises(OverflowError, A2_16, "replace", "AA", A2_16+A2_16)
844
845 def test_removeprefix(self):
846 self.checkequal('am', 'spam', 'removeprefix', 'sp')

Callers

nothing calls this directly

Calls 1

checkraisesMethod · 0.95

Tested by

no test coverage detected