hy/tests/test_lex.py

14 lines
433 B
Python
Raw Normal View History

2013-03-01 04:27:20 +01:00
from hy.lex import tokenize
2013-03-01 04:37:23 +01:00
from hy.models.expression import HyExpression
from hy.models.symbol import HySymbol
2013-03-03 00:40:00 +01:00
from hy.models.string import HyString
2013-03-01 04:27:20 +01:00
2013-03-03 00:40:00 +01:00
def test_lex_expression_symbols():
2013-03-01 04:27:20 +01:00
objs = tokenize("(foo bar)")
2013-03-01 04:37:23 +01:00
assert objs == [HyExpression([HySymbol("foo"), HySymbol("bar")])]
2013-03-03 00:40:00 +01:00
def test_lex_expression_strings():
objs = tokenize("(foo \"bar\")")
assert objs == [HyExpression([HySymbol("foo"), HyString("bar")])]