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

Method test_huge_rshift_of_huge

Lib/test/test_long.py:1012–1017  ·  view source on GitHub ↗
(self, size)

Source from the content-addressed store, hash-verified

1010 @support.cpython_only
1011 @support.bigmemtest(2**32, memuse=0.2)
1012 def test_huge_rshift_of_huge(self, size):
1013 huge = ((1 << 500) + 11) << size
1014 self.assertEqual(huge.bit_length(), size + 501)
1015 self.assertEqual(huge.bit_count(), 4)
1016 self.assertEqual(huge >> (size + 1), (1 << 499) + 5)
1017 self.assertEqual(huge >> (size + 1000), 0)
1018
1019 def test_small_rshift(self):
1020 self.assertEqual(42 >> 1, 21)

Callers

nothing calls this directly

Calls 3

bit_countMethod · 0.80
assertEqualMethod · 0.45
bit_lengthMethod · 0.45

Tested by

no test coverage detected