[Python-checkins] CVS: python/dist/src/Lib/test test_b1.py,1.35,1.36
Tim Peters
tim_one@users.sourceforge.net
2001年7月26日 13:02:19 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv7893/python/dist/src/Lib/test
Modified Files:
test_b1.py
Log Message:
SF bug #444510: int() should guarantee truncation.
It's guaranteed now, assuming the platform modf() works correctly.
Index: test_b1.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_b1.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** test_b1.py 2001年06月18日 19:21:11 1.35
--- test_b1.py 2001年07月26日 20:02:17 1.36
***************
*** 367,370 ****
--- 367,383 ----
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.