summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_b1.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-03-25 21:25:01 (GMT)
committerGuido van Rossum <guido@python.org>1999-03-25 21:25:01 (GMT)
commit52a0d7d802f802a7b613ea72701b0e103635000b (patch)
treeabc5e367daeefb06bdfd8fd4356e6fec911e9838 /Lib/test/test_b1.py
parentcb1f2420ea48c76f84a4542886b869da008423d4 (diff)
downloadcpython-52a0d7d802f802a7b613ea72701b0e103635000b.zip
cpython-52a0d7d802f802a7b613ea72701b0e103635000b.tar.gz
cpython-52a0d7d802f802a7b613ea72701b0e103635000b.tar.bz2
Add tests for float() and complex() with string args (Nick/Stephanie
Lockwood).
Diffstat (limited to 'Lib/test/test_b1.py')
-rw-r--r--Lib/test/test_b1.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_b1.py b/Lib/test/test_b1.py
index 7155294..d9c6320 100644
--- a/Lib/test/test_b1.py
+++ b/Lib/test/test_b1.py
@@ -94,6 +94,7 @@ if complex(0j, 3.14j) <> -3.14+0j: raise TestFailed, 'complex(0j, 3.14j)'
if complex(0.0, 3.14j) <> -3.14+0j: raise TestFailed, 'complex(0.0, 3.14j)'
if complex(0j, 3.14) <> 3.14j: raise TestFailed, 'complex(0j, 3.14)'
if complex(0.0, 3.14) <> 3.14j: raise TestFailed, 'complex(0.0, 3.14)'
+if complex(" 3.14+J ") <> 3.14+1j: raise TestFailed, 'complex(" 3.14+J )"'
class Z:
def __complex__(self): return 3.14j
z = Z()
@@ -206,6 +207,7 @@ print 'float'
if float(3.14) <> 3.14: raise TestFailed, 'float(3.14)'
if float(314) <> 314.0: raise TestFailed, 'float(314)'
if float(314L) <> 314.0: raise TestFailed, 'float(314L)'
+if float(" 3.14 ") <> 3.14: raise TestFailed, 'float(" 3.14 ")'
print 'getattr'
import sys