]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
SF Patch #497487 add test to compare conjugate of a complex number
authorNeal Norwitz <nnorwitz@gmail.com>
Sat, 29 Dec 2001 14:31:46 +0000 (14:31 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sat, 29 Dec 2001 14:31:46 +0000 (14:31 +0000)
Lib/test/test_complex.py

index 65fccc39cd5caea79ceb5e483cc62c9c8acd64b4..1fa0ee0e7e19a99dd8940c9405c860171d44c0c1 100644 (file)
@@ -1,4 +1,4 @@
-from test_support import TestFailed
+from test_support import TestFailed, vereq
 from random import random
 
 # These tests ensure that complex math does the right thing; tests of
@@ -63,6 +63,9 @@ for i in range(100):
 if complex(0.0, 0.0):
     raise TestFailed("complex(0.0, 0.0) should be false")
 
+if vereq(complex(5.3, 9.8).conjugate(), 5.3-9.8j):
+    raise TestFailed("complex.conjugate() didn't work")
+
 try:
     print int(5+3j)
 except TypeError: