more list tests
This commit is contained in:
parent
11fe591d38
commit
a8c17db048
@ -2,6 +2,7 @@ from hy.lex.tokenize import tokenize
|
|||||||
|
|
||||||
|
|
||||||
def test_list_lex():
|
def test_list_lex():
|
||||||
|
"""test basic lexing of lists"""
|
||||||
fn = tokenize("(fn [1 2 3 4])")[0]
|
fn = tokenize("(fn [1 2 3 4])")[0]
|
||||||
assert fn == [
|
assert fn == [
|
||||||
"fn", ["1", "2", "3", "4"]
|
"fn", ["1", "2", "3", "4"]
|
||||||
@ -9,6 +10,7 @@ def test_list_lex():
|
|||||||
|
|
||||||
|
|
||||||
def test_list_recurse():
|
def test_list_recurse():
|
||||||
|
""" test we can recurse lists """
|
||||||
fn = tokenize("(fn [1 2 3 4 [5 6 7]])")[0]
|
fn = tokenize("(fn [1 2 3 4 [5 6 7]])")[0]
|
||||||
assert fn == [
|
assert fn == [
|
||||||
"fn", ["1", "2", "3", "4", ["5", "6", "7"]]
|
"fn", ["1", "2", "3", "4", ["5", "6", "7"]]
|
||||||
@ -16,6 +18,7 @@ def test_list_recurse():
|
|||||||
|
|
||||||
|
|
||||||
def test_double_rainbow():
|
def test_double_rainbow():
|
||||||
|
""" DOUBLE LISTS """
|
||||||
fn = tokenize("(fn [1 2 3 4] [5 6 7])")[0]
|
fn = tokenize("(fn [1 2 3 4] [5 6 7])")[0]
|
||||||
assert fn == [
|
assert fn == [
|
||||||
"fn", ["1", "2", "3", "4"], ["5", "6", "7"]
|
"fn", ["1", "2", "3", "4"], ["5", "6", "7"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user