Update a disassembly test for Python 3.7

This commit is contained in:
Kodi Arfer 2018-03-24 12:33:44 -07:00
parent f27eda16e1
commit 268eba93fe

View File

@ -11,7 +11,7 @@
pytest)
(import sys)
(import [hy._compat [PY3 PY35]])
(import [hy._compat [PY3 PY35 PY37]])
(defn test-sys-argv []
"NATIVE: test sys.argv"
@ -1606,18 +1606,21 @@
(defn test-disassemble []
"NATIVE: Test the disassemble function"
(if PY35
(assert (= (disassemble '(do (leaky) (leaky) (macros)))
"Module(
(assert (= (disassemble '(do (leaky) (leaky) (macros))) (cond
[PY37 "Module(
body=[Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[])),
Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[])),
Expr(value=Call(func=Name(id='macros'), args=[], keywords=[]))])"))
(assert (= (disassemble '(do (leaky) (leaky) (macros)))
"Module(
Expr(value=Call(func=Name(id='macros'), args=[], keywords=[]))],
docstring=None)"]
[PY35 "Module(
body=[Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[])),
Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[])),
Expr(value=Call(func=Name(id='macros'), args=[], keywords=[]))])"]
[True "Module(
body=[
Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[], starargs=None, kwargs=None)),
Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[], starargs=None, kwargs=None)),
Expr(value=Call(func=Name(id='macros'), args=[], keywords=[], starargs=None, kwargs=None))])")))
Expr(value=Call(func=Name(id='macros'), args=[], keywords=[], starargs=None, kwargs=None))])"])))
(assert (= (disassemble '(do (leaky) (leaky) (macros)) True)
"leaky()
leaky()