diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-07-26 20:02:17 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-07-26 20:02:17 (GMT) |
commit | 7321ec437b0aef968b83137d9c638551cabab706 (patch) | |
tree | 83890a0d039e47d282d2abda1f8eb173710de3f8 /Lib/test | |
parent | 7cf92fa1c891b53e6143e090009911c0231bb24a (diff) | |
download | cpython-7321ec437b0aef968b83137d9c638551cabab706.zip cpython-7321ec437b0aef968b83137d9c638551cabab706.tar.gz cpython-7321ec437b0aef968b83137d9c638551cabab706.tar.bz2 |
SF bug #444510: int() should guarantee truncation.
It's guaranteed now, assuming the platform modf() works correctly.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_b1.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_b1.py b/Lib/test/test_b1.py index e2cc49b..bddd157 100644 --- a/Lib/test/test_b1.py +++ b/Lib/test/test_b1.py @@ -366,6 +366,19 @@ except ValueError: pass else: raise TestFailed, "int(%s)" % `s[1:]` + " should raise ValueError" +try: + int(1e100) +except OverflowError: + pass +else: + raise TestFailed("int(1e100) expected OverflowError") +try: + int(-1e100) +except OverflowError: + pass +else: + raise TestFailed("int(-1e100) expected OverflowError") + # SF bug 434186: 0x80000000/2 != 0x80000000>>1. # Worked by accident in Windows release build, but failed in debug build. |