update tests

This commit is contained in:
Gered 2014-03-02 10:34:29 -05:00
parent 512fcfa31c
commit 12d72afa5a

View file

@ -213,16 +213,16 @@
"java.lang.Boolean") "java.lang.Boolean")
"boolean typename via model-map") "boolean typename via model-map")
(is (= (render "{{typename(x)}}" {:x '(1 2 3 4 5)}) (is (= (render "{{typename(x)}}" {:x '(1 2 3 4 5)})
"clojure.lang.PersistentList") "clojure.lang.LazySeq")
"list typename via model-map") "list typename via model-map")
(is (= (render "{{typename(x)}}" {:x [1 2 3 4 5]}) (is (= (render "{{typename(x)}}" {:x [1 2 3 4 5]})
"clojure.lang.PersistentVector") "clojure.lang.LazySeq")
"vector typename via model-map") "vector typename via model-map")
(is (= (render "{{typename(x)}}" {:x {:a 1 :b "foo" :c nil}}) (is (= (render "{{typename(x)}}" {:x {:a 1 :b "foo" :c nil}})
"clojure.lang.PersistentArrayMap") "clojure.lang.PersistentArrayMap")
"map typename via model-map") "map typename via model-map")
(is (= (render "{{typename(x)}}" {:x #{1 2 3 4 5}}) (is (= (render "{{typename(x)}}" {:x #{1 2 3 4 5}})
"clojure.lang.PersistentHashSet") "clojure.lang.LazySeq")
"set typename via model-map") "set typename via model-map")
; verify that the clojure function recognizes the correct types when the variable is passed via a constant ; verify that the clojure function recognizes the correct types when the variable is passed via a constant
@ -243,13 +243,13 @@
"java.lang.Boolean") "java.lang.Boolean")
"boolean typename via constant value embedded in the template") "boolean typename via constant value embedded in the template")
(is (= (render "{{typename([1, 2, 3, 4, 5])}}" nil) (is (= (render "{{typename([1, 2, 3, 4, 5])}}" nil)
"java.util.ArrayList") "clojure.lang.LazySeq")
"list typename via constant value embedded in the template") "list typename via constant value embedded in the template")
(is (= (render "{{typename(1..5)}}" nil) (is (= (render "{{typename(1..5)}}" nil)
"java.util.ArrayList") "clojure.lang.LazySeq")
"vector typename via constant value embedded in the template") "vector typename via constant value embedded in the template")
(is (= (render "{{typename({a: 1, b: 'foo', c: null})}}" nil) (is (= (render "{{typename({a: 1, b: 'foo', c: null})}}" nil)
"java.util.HashMap") "clojure.lang.PersistentArrayMap")
"map typename via constant value embedded in the template") "map typename via constant value embedded in the template")
; simple passing / returning... not doing anything exciting with the arguments ; simple passing / returning... not doing anything exciting with the arguments
@ -270,16 +270,16 @@
"true") "true")
"boolean via model-map") "boolean via model-map")
(is (= (render "{{identity(x)}}" {:x '(1 2 3 4 5)}) (is (= (render "{{identity(x)}}" {:x '(1 2 3 4 5)})
"(1 2 3 4 5)") "[1, 2, 3, 4, 5]")
"list via model-map") "list via model-map")
(is (= (render "{{identity(x)}}" {:x [1 2 3 4 5]}) (is (= (render "{{identity(x)}}" {:x [1 2 3 4 5]})
"[1 2 3 4 5]") "[1, 2, 3, 4, 5]")
"vector via model-map") "vector via model-map")
(is (= (render "{{identity(x)}}" {:x {:a 1 :b "foo" :c nil}}) (is (= (render "{{identity(x)}}" {:x {:a 1 :b "foo" :c nil}})
"{\"a\" 1, \"c\" nil, \"b\" \"foo\"}") "{b=foo, c=null, a=1}")
"map via model-map") "map via model-map")
(is (= (render "{{identity(x)}}" {:x #{1 2 3 4 5}}) (is (= (render "{{identity(x)}}" {:x #{1 2 3 4 5}})
"#{1 2 3 4 5}") "[1, 2, 3, 4, 5]")
"set via model-map") "set via model-map")
; simple passing / returning... not doing anything exciting with the arguments ; simple passing / returning... not doing anything exciting with the arguments
@ -318,7 +318,7 @@
"1 2 3 4 5 ") "1 2 3 4 5 ")
"vector (iterating over a model-map var passed to a function and returned from it)") "vector (iterating over a model-map var passed to a function and returned from it)")
(is (= (render "{% for k, v in identity(x) %}{{k}}: {{v}} {% endfor %}" {:x {:a 1 :b "foo" :c nil}}) (is (= (render "{% for k, v in identity(x) %}{{k}}: {{v}} {% endfor %}" {:x {:a 1 :b "foo" :c nil}})
"a: 1 c: null b: foo ") "b: foo c: null a: 1 ")
"map (iterating over a model-map var passed to a function and returned from it)") "map (iterating over a model-map var passed to a function and returned from it)")
(is (= (render "{% for i in identity(x) %}{{i}} {% endfor %}" {:x #{1 2 3 4 5}}) (is (= (render "{% for i in identity(x) %}{{i}} {% endfor %}" {:x #{1 2 3 4 5}})
"1 2 3 4 5 ") "1 2 3 4 5 ")