Add tests for expr-in-dict

This commit is contained in:
Nicolas Dandrimont 2013-05-14 12:01:23 +02:00
parent 9e03e0e6ec
commit 3252af3129
2 changed files with 12 additions and 0 deletions

View File

@ -192,6 +192,12 @@ def test_dicts():
HyDict(["foo", "bar",
"bar", "baz"])])]
objs = tokenize("{(foo bar) (baz quux)}")
assert objs == [HyDict([
HyExpression([HySymbol("foo"), HySymbol("bar")]),
HyExpression([HySymbol("baz"), HySymbol("quux")])
])]
def test_nospace():
""" Ensure we can tokenize without spaces if we have to """

View File

@ -15,6 +15,12 @@
(assert (= [1 2 3 4] (+ [1 2] [3 4]))))
(defn test-dicts []
"NATIVE: test dicts work right"
(assert (= {1 2 3 4} {3 4 1 2}))
(assert (= {1 2 3 4} {1 (+ 1 1) 3 (+ 2 2)})))
(defn test-setv-get []
"NATIVE: test setv works on a get expression"
(setv foo [0 1 2])