summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_b1.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_b1.py')
-rw-r--r--Lib/test/test_b1.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_b1.py b/Lib/test/test_b1.py
index 978f674..b328b38 100644
--- a/Lib/test/test_b1.py
+++ b/Lib/test/test_b1.py
@@ -23,6 +23,10 @@ if abs(0L) != 0L: raise TestFailed, 'abs(0L)'
if abs(1234L) != 1234L: raise TestFailed, 'abs(1234L)'
if abs(-1234L) != 1234L: raise TestFailed, 'abs(-1234L)'
+try: abs('a')
+except TypeError: pass
+else: raise TestFailed, 'abs("a")'
+
print 'apply'
def f0(*args):
if args != (): raise TestFailed, 'f0 called with ' + `args`
@@ -416,6 +420,10 @@ x = -1-sys.maxint
if x >> 1 != x//2:
raise TestFailed("x >> 1 != x/2 when x == -1-sys.maxint")
+try: int('123\0')
+except ValueError: pass
+else: raise TestFailed("int('123\0') didn't raise exception")
+
print 'isinstance'
class C:
pass
@@ -504,6 +512,10 @@ for s, v in L + LL:
except ValueError, e:
raise TestFailed, "long(%s) raised ValueError: %s" % (`ss`, e)
+try: long('123\0')
+except ValueError: pass
+else: raise TestFailed("long('123\0') didn't raise exception")
+
print 'map'
if map(None, 'hello world') != ['h','e','l','l','o',' ','w','o','r','l','d']:
raise TestFailed, 'map(None, \'hello world\')'