hy/tests/lexer/test_list_lexing.py
Paul Tagliamonte a8c17db048 more list tests
2012-12-15 18:24:40 -05:00

26 lines
563 B
Python

from hy.lex.tokenize import tokenize
def test_list_lex():
"""test basic lexing of lists"""
fn = tokenize("(fn [1 2 3 4])")[0]
assert fn == [
"fn", ["1", "2", "3", "4"]
]
def test_list_recurse():
""" test we can recurse lists """
fn = tokenize("(fn [1 2 3 4 [5 6 7]])")[0]
assert fn == [
"fn", ["1", "2", "3", "4", ["5", "6", "7"]]
]
def test_double_rainbow():
""" DOUBLE LISTS """
fn = tokenize("(fn [1 2 3 4] [5 6 7])")[0]
assert fn == [
"fn", ["1", "2", "3", "4"], ["5", "6", "7"]
]