adding more testing

This commit is contained in:
Paul R. Tagliamonte 2013-03-03 13:12:23 -05:00
parent a9b5d851b2
commit 9b58f893cb

View File

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