Test bad decoration

This commit is contained in:
Paul Tagliamonte 2013-04-01 19:38:58 -04:00
parent c098db9b51
commit 426c7cd829

View File

@ -64,3 +64,12 @@ def test_ast_anon_fns_basics():
""" Ensure anon fns work. """
code = hy_compile(tokenize("(fn (x) (* x x))")).body[0]
assert type(code) == ast.FunctionDef
def test_ast_non_decoratable():
""" Ensure decorating garbage breaks """
try:
hy_compile(tokenize("(decorate-with (foo) (* x x))"))
assert True == False
except TypeError:
pass