Fix SF bug 1441486: bad unary minus folding in compiler.

This commit is contained in:
Neil Schemenauer 2006-07-09 21:19:29 +00:00
parent 0e07b60a4e
commit 6ec6ab02c3
3 changed files with 60 additions and 20 deletions

View file

@ -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