summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_b1.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-12-11 04:37:34 (GMT)
committerGuido van Rossum <guido@python.org>2001-12-11 04:37:34 (GMT)
commit29d260670eff2d04b98d737ad14928163602a41a (patch)
tree6cc40f6d54623d96e5784f573c7189742b14b129 /Lib/test/test_b1.py
parent2a64f4693ddcd552c4c6e709eaaba7cf829464d8 (diff)
downloadcpython-29d260670eff2d04b98d737ad14928163602a41a.zip
cpython-29d260670eff2d04b98d737ad14928163602a41a.tar.gz
cpython-29d260670eff2d04b98d737ad14928163602a41a.tar.bz2
Additional coverage tests by Neil Norwitz.
(SF patch #491418, #491420, #491421.)
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\')'