diff --git a/tests/resources/pydemo.hy b/tests/resources/pydemo.hy index c283f21..27d0ee4 100644 --- a/tests/resources/pydemo.hy +++ b/tests/resources/pydemo.hy @@ -19,7 +19,8 @@ Call me Ishmael. Some years ago—never mind how long precisely—having little (setv mynan NaN) (setv pinf Inf) (setv ninf -Inf) -;(setv mycomplex -Inf+5j) ; https://github.com/berkerpeksag/astor/issues/100 +(setv mycomplex -Inf+5j) +(setv mycomplex2 NaN-Infj) (setv num-expr (+ 3 (* 5 2) (- 6 (// 8 2)) (* (+ 1 2) (- 3 5)))) ; = 9 diff --git a/tests/test_hy2py.py b/tests/test_hy2py.py index 9080429..f63c123 100644 --- a/tests/test_hy2py.py +++ b/tests/test_hy2py.py @@ -41,6 +41,12 @@ def assert_stuff(m): assert m.pinf > 0 assert math.isinf(m.ninf) assert m.ninf < 0 + assert math.isinf(m.mycomplex.real) + assert m.mycomplex.real < 0 + assert m.mycomplex.imag == 5 + assert math.isnan(m.mycomplex2.real) + assert math.isinf(m.mycomplex2.imag) + assert m.mycomplex2.imag < 0 assert m.num_expr == 9