]> granicus.if.org Git - python/commitdiff
Change test_overflow to test_no_overflow; looks like big int literals
authorTim Peters <tim.peters@gmail.com>
Mon, 27 Aug 2001 21:45:32 +0000 (21:45 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 27 Aug 2001 21:45:32 +0000 (21:45 +0000)
are auto-coerced to longs now, but this test still expected OverflowError.
I can't imagine this test failure was unique to Windows.

Lib/test/test_unary.py

index 04191676ce3363c49837ab27f9705e72d7c67e00..3402c55c19142caefcde3d9a0343d12477b2b813 100644 (file)
@@ -27,10 +27,11 @@ class UnaryOpTestCase(unittest.TestCase):
         self.assert_(--2 == 2)
         self.assert_(-2L == 0 - 2L)
 
-    def test_overflow(self):
-        self.assertRaises(OverflowError, eval, "+" + ("9" * 32))
-        self.assertRaises(OverflowError, eval, "-" + ("9" * 32))
-        self.assertRaises(OverflowError, eval, "~" + ("9" * 32))
+    def test_no_overflow(self):
+        nines = "9" * 32
+        self.assert_(eval("+" + nines) == eval("+" + nines + "L"))
+        self.assert_(eval("-" + nines) == eval("-" + nines + "L"))
+        self.assert_(eval("~" + nines) == eval("~" + nines + "L"))
 
     def test_bad_types(self):
         for op in '+', '-', '~':