From faf782560cbfdfc064744c048e07479c480087cb Mon Sep 17 00:00:00 2001 From: Bob Tolbert Date: Tue, 31 Dec 2013 09:53:43 -0700 Subject: [PATCH] Fixing tests for new 'for' syntax --- tests/compilers/test_ast.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/compilers/test_ast.py b/tests/compilers/test_ast.py index 76a9e1d..b191c17 100644 --- a/tests/compilers/test_ast.py +++ b/tests/compilers/test_ast.py @@ -313,7 +313,7 @@ def test_ast_valid_while(): def test_ast_valid_for(): "Make sure AST can compile valid for" - can_compile("(for [[a 2]])") + can_compile("(for [[a 2]] (print a))") def test_ast_invalid_for(): @@ -452,14 +452,14 @@ def test_for_compile_error(): assert(False) try: - can_compile("(fn [] (for [x]))") - except HyTypeError as e: - assert(e.message == "`for' requires an even number of elements in its first argument") # noqa - else: - assert(False) - - try: - can_compile("(fn [] (for [x xx]))") + can_compile("(fn [] (for [[x]]))") + except HyTypeError as e: + assert(e.message == "`for' requires a body to evaluate") + else: + assert(False) + + try: + can_compile("(fn [] (for [[x xx]]))") except HyTypeError as e: assert(e.message == "`for' requires a body to evaluate") else: