Add some failing tests in.

This commit is contained in:
Paul R. Tagliamonte 2013-03-03 11:18:13 -05:00
parent 95657f64bc
commit 6661d85323
2 changed files with 19 additions and 2 deletions

View File

@ -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):

View File

@ -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