SF Patch #494874 add tests for int()/long() invalid parameters
diff --git a/Lib/test/test_b1.py b/Lib/test/test_b1.py
index f2d0c24..17f0411 100644
--- a/Lib/test/test_b1.py
+++ b/Lib/test/test_b1.py
@@ -432,6 +432,21 @@
except ValueError: pass
else: raise TestFailed("int('123\0') didn't raise exception")
+try: int('53', 40)
+except ValueError: pass
+else: raise TestFailed("int('53', 40) didn't raise ValueError")
+
+try: int('1' * 512)
+except ValueError: pass
+else: raise TestFailed("int('1' * 512) didn't raise ValueError")
+
+try: int(1, 12)
+except TypeError: pass
+else: raise TestFailed("int(1, 12) didn't raise TypeError")
+
+if int('0123', 0) != 83:
+ raise TestFailed("int('0123', 0) != 83")
+
print 'isinstance'
class C:
pass
@@ -524,6 +539,14 @@
except ValueError: pass
else: raise TestFailed("long('123\0') didn't raise exception")
+try: long('53', 40)
+except ValueError: pass
+else: raise TestFailed("long('53', 40) didn't raise ValueError")
+
+try: long(1, 12)
+except TypeError: pass
+else: raise TestFailed("long(1, 12) didn't raise TypeError")
+
print 'map'
if map(None, 'hello world') != ['h','e','l','l','o',' ','w','o','r','l','d']:
raise TestFailed, 'map(None, \'hello world\')'