You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
More complex complex test
This commit is contained in:
1
test/.gitignore
vendored
1
test/.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
|
/.coverage
|
||||||
/nohup.out
|
/nohup.out
|
||||||
|
BIN
test/bytecode_3.6_run/02_var_annotate.pyc
Normal file
BIN
test/bytecode_3.6_run/02_var_annotate.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_3.7_run/10_complex.pyc
Normal file
BIN
test/bytecode_3.7_run/10_complex.pyc
Normal file
Binary file not shown.
@@ -1,4 +1,5 @@
|
|||||||
# Greatly simplified from from 3.3 test_complex.py
|
# Greatly simplified from from 3.3 test_complex.py
|
||||||
|
from math import atan2
|
||||||
|
|
||||||
# RUNNABLE!
|
# RUNNABLE!
|
||||||
def assertCloseAbs(x, y, eps=1e-09):
|
def assertCloseAbs(x, y, eps=1e-09):
|
||||||
@@ -38,14 +39,16 @@ def test_truediv():
|
|||||||
check_div(x, y)
|
check_div(x, y)
|
||||||
|
|
||||||
def test_plus_minus_0j():
|
def test_plus_minus_0j():
|
||||||
z1, z2 = (0j, (-0 - 0j))
|
assert -0j == -0j == complex(0.0, 0.0)
|
||||||
|
assert -0-0j == -0j == complex(0.0, 0.0)
|
||||||
|
z1, z2 = (0j, -0j)
|
||||||
assert atan2(z1.imag, -1.0) == atan2(0.0, -1.0)
|
assert atan2(z1.imag, -1.0) == atan2(0.0, -1.0)
|
||||||
assert atan2(z2.imag, -1.0), atan2(-0.0, -1.0)
|
# assert atan2(z2.imag, -1.0), atan2(-0.0, -1.0)
|
||||||
|
|
||||||
# Check that we can handle -inf, and inf as a complex numbers.
|
# Check that we can handle -inf, and inf as a complex numbers.
|
||||||
# And put it in a tuple and a list to make it harder.
|
# And put it in a tuple and a list to make it harder.
|
||||||
z1, z2 = (-1e1000j, 1e1000j)
|
z1, z2 = (-1e1000j, 1e1000j)
|
||||||
assert z1 in [-1e1000j, 1e1000j]
|
assert z1 in [-1e1000j, 1e1000j]
|
||||||
assert z1 == z2
|
assert z1 != z2
|
||||||
test_truediv()
|
test_truediv()
|
||||||
test_plus_minus0j()
|
test_plus_minus_0j()
|
||||||
|
Reference in New Issue
Block a user