summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-05-12 20:43:07 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-05-12 20:43:07 (GMT)
commit66113bb74a37e882181ba5c7db091c30c5c7693e (patch)
treebdd9d35cc9eae47bbd22e5cbc1c570fd42b19485
parent5fb195f854e6fe016015c98dfd379c1102950c04 (diff)
parent7fe1049fcbb623609c79c8f9ecc8e5ffc7cf6439 (diff)
downloadcpython-66113bb74a37e882181ba5c7db091c30c5c7693e.zip
cpython-66113bb74a37e882181ba5c7db091c30c5c7693e.tar.gz
cpython-66113bb74a37e882181ba5c7db091c30c5c7693e.tar.bz2
(Merge 3.4) Issue #21422: Add a test to check that bool << int and bool >> int
return an int
-rw-r--r--Lib/test/test_long.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py
index 13152ec..5f14795 100644
--- a/Lib/test/test_long.py
+++ b/Lib/test/test_long.py
@@ -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)