summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmath.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-06-14 07:40:10 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-06-14 07:40:10 (GMT)
commitb67ad7e67159365faa1e61d436df99010bc7c97d (patch)
tree70b9fafcf1cc3d55b09fcd79d3fa23bde889a5a8 /Lib/test/test_cmath.py
parentad21945d03bd792a6a93e1dbd2addd6b7b63dbee (diff)
downloadcpython-b67ad7e67159365faa1e61d436df99010bc7c97d.zip
cpython-b67ad7e67159365faa1e61d436df99010bc7c97d.tar.gz
cpython-b67ad7e67159365faa1e61d436df99010bc7c97d.tar.bz2
Patch #826074: cmath.log optional base argument, fixes #823209
(Contributed by Andrew Gaul.)
Diffstat (limited to 'Lib/test/test_cmath.py')
-rwxr-xr-xLib/test/test_cmath.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/Lib/test/test_cmath.py b/Lib/test/test_cmath.py
index c409699..6e39292 100755
--- a/Lib/test/test_cmath.py
+++ b/Lib/test/test_cmath.py
@@ -2,8 +2,25 @@
""" Simple test script for cmathmodule.c
Roger E. Masse
"""
-import cmath
-from test.test_support import verbose
+import cmath, math
+from test.test_support import verbose, verify, TestFailed
+
+verify(abs(cmath.log(10) - math.log(10)) < 1e-9)
+verify(abs(cmath.log(10,2) - math.log(10,2)) < 1e-9)
+try:
+ cmath.log('a')
+except TypeError:
+ pass
+else:
+ raise TestFailed
+
+try:
+ cmath.log(10, 'a')
+except TypeError:
+ pass
+else:
+ raise TestFailed
+
testdict = {'acos' : 1.0,
'acosh' : 1.0,