diff --git a/tests/lex/test_lex.py b/tests/lex/test_lex.py index 490e167..7b90750 100644 --- a/tests/lex/test_lex.py +++ b/tests/lex/test_lex.py @@ -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 """ diff --git a/tests/native_tests/language.hy b/tests/native_tests/language.hy index 0254493..3658012 100644 --- a/tests/native_tests/language.hy +++ b/tests/native_tests/language.hy @@ -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])