mirror of
https://github.com/python/cpython.git
synced 2025-11-25 12:44:13 +00:00
Issue #21422: Add a test to check that bool << int and bool >> int return an int
This commit is contained in:
parent
bf88ffba5e
commit
7fe1049fcb
1 changed files with 7 additions and 0 deletions
|
|
@ -1235,6 +1235,13 @@ class LongTest(unittest.TestCase):
|
|||
for n in map(int, integers):
|
||||
self.assertEqual(n, 0)
|
||||
|
||||
def test_shift_bool(self):
|
||||
# Issue #21422: ensure that bool << int and bool >> int return int
|
||||
for value in (True, False):
|
||||
for shift in (0, 2):
|
||||
self.assertEqual(type(value << shift), int)
|
||||
self.assertEqual(type(value >> shift), int)
|
||||
|
||||
|
||||
def test_main():
|
||||
support.run_unittest(LongTest)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue