diff --git a/tests/compilers/test_ast.py b/tests/compilers/test_ast.py index 163de1b..64a3a86 100644 --- a/tests/compilers/test_ast.py +++ b/tests/compilers/test_ast.py @@ -18,7 +18,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. -from hy.compilers.pyast import HyASTCompiler +from hy.compilers.pyast import HyASTCompiler, HyCompileError from hy.lex import tokenize import ast @@ -32,6 +32,15 @@ def _ast_spotcheck(arg, root, secondary): assert getattr(root, arg) == getattr(secondary, arg) +def test_ast_bad_type(): + compiler = HyASTCompiler() + try: + compiler.compile("foo") + assert True == False + except HyCompileError: + pass + + def test_ast_expression_basics(): """ Ensure basic AST expression conversion works. """ compiler = HyASTCompiler()