diff options
author | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2006-07-09 21:19:29 (GMT) |
---|---|---|
committer | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2006-07-09 21:19:29 (GMT) |
commit | 6ec6ab02c33b1b879fef7058bcfecd4edaa66bd9 (patch) | |
tree | 8774584d013bbdd1538b5ef8b9813805f2a8bf05 /Lib/test/test_compile.py | |
parent | 0e07b60a4e44129cfafaeacac765cf957e2ea219 (diff) | |
download | cpython-6ec6ab02c33b1b879fef7058bcfecd4edaa66bd9.zip cpython-6ec6ab02c33b1b879fef7058bcfecd4edaa66bd9.tar.gz cpython-6ec6ab02c33b1b879fef7058bcfecd4edaa66bd9.tar.bz2 |
Fix SF bug 1441486: bad unary minus folding in compiler.
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r-- | Lib/test/test_compile.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 7c24d1b..bacec35 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -211,6 +211,10 @@ if 1: self.assertEqual(eval("-" + all_one_bits), -18446744073709551615L) else: self.fail("How many bits *does* this machine have???") + # Verify treatment of contant folding on -(sys.maxint+1) + # i.e. -2147483648 on 32 bit platforms. Should return int, not long. + self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 1)), int)) + self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 2)), long)) def test_sequence_unpacking_error(self): # Verify sequence packing/unpacking with "or". SF bug #757818 |