From 426c7cd829355e4a1fce5ba4cd46bb2041e94a4b Mon Sep 17 00:00:00 2001 From: Paul Tagliamonte Date: Mon, 1 Apr 2013 19:38:58 -0400 Subject: [PATCH] Test bad decoration --- tests/compilers/test_ast.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/compilers/test_ast.py b/tests/compilers/test_ast.py index 1fee013..848fd69 100644 --- a/tests/compilers/test_ast.py +++ b/tests/compilers/test_ast.py @@ -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