Add some failing tests in.
This commit is contained in:
parent
95657f64bc
commit
6661d85323
@ -20,6 +20,9 @@
|
|||||||
|
|
||||||
from hy.compilers import HyCompiler
|
from hy.compilers import HyCompiler
|
||||||
|
|
||||||
|
from hy.models.expression import HyExpression
|
||||||
|
from hy.modesl.symbol import HySymbol
|
||||||
|
|
||||||
|
|
||||||
class HyASTCompiler(HyCompiler):
|
class HyASTCompiler(HyCompiler):
|
||||||
|
|
||||||
|
@ -20,9 +20,23 @@
|
|||||||
|
|
||||||
from hy.compilers.ast import HyASTCompiler
|
from hy.compilers.ast import HyASTCompiler
|
||||||
from hy.lex import tokenize
|
from hy.lex import tokenize
|
||||||
|
import ast
|
||||||
|
|
||||||
|
|
||||||
def test_ast_expression_basics():
|
def test_ast_expression_basics():
|
||||||
""" Ensure basic AST conversion works. """
|
""" Ensure basic AST expression conversion works. """
|
||||||
compiler = HyASTCompiler()
|
compiler = HyASTCompiler()
|
||||||
code = compiler.compile(tokenize("(foo bar)"))
|
code = compiler.compile(tokenize("(foo bar)"))[0]
|
||||||
|
tree = ast.Call(
|
||||||
|
func=ast.Name(
|
||||||
|
id="foo",
|
||||||
|
ctx=ast.Load(),
|
||||||
|
),
|
||||||
|
args=[
|
||||||
|
ast.Name(id="bar", ctx=ast.Load())
|
||||||
|
],
|
||||||
|
keywords=[],
|
||||||
|
starargs=None,
|
||||||
|
kwargs=None,
|
||||||
|
)
|
||||||
|
assert code == tree
|
||||||
|
Loading…
Reference in New Issue
Block a user