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

Method test_extended_set_del_slice

Lib/test/test_bytes.py:1533–1552  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1531 self.assertLessEqual(sys.getsizeof(b), size)
1532
1533 def test_extended_set_del_slice(self):
1534 indices = (0, None, 1, 3, 19, 300, 1<<333, sys.maxsize,
1535 -1, -2, -31, -300)
1536 for start in indices:
1537 for stop in indices:
1538 # Skip invalid step 0
1539 for step in indices[1:]:
1540 L = list(range(255))
1541 b = bytearray(L)
1542 # Make sure we have a slice of exactly the right length,
1543 # but with different data.
1544 data = L[start:stop:step]
1545 data.reverse()
1546 L[start:stop:step] = data
1547 b[start:stop:step] = data
1548 self.assertEqual(b, bytearray(L))
1549
1550 del L[start:stop:step]
1551 del b[start:stop:step]
1552 self.assertEqual(b, bytearray(L))
1553
1554 def test_setslice_trap(self):
1555 # This test verifies that we correctly handle assigning self

Callers

nothing calls this directly

Calls 3

listClass · 0.85
reverseMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected