update tests
This commit is contained in:
parent
512fcfa31c
commit
12d72afa5a
|
@ -213,16 +213,16 @@
|
|||
"java.lang.Boolean")
|
||||
"boolean typename via model-map")
|
||||
(is (= (render "{{typename(x)}}" {:x '(1 2 3 4 5)})
|
||||
"clojure.lang.PersistentList")
|
||||
"clojure.lang.LazySeq")
|
||||
"list typename via model-map")
|
||||
(is (= (render "{{typename(x)}}" {:x [1 2 3 4 5]})
|
||||
"clojure.lang.PersistentVector")
|
||||
"clojure.lang.LazySeq")
|
||||
"vector typename via model-map")
|
||||
(is (= (render "{{typename(x)}}" {:x {:a 1 :b "foo" :c nil}})
|
||||
"clojure.lang.PersistentArrayMap")
|
||||
"map typename via model-map")
|
||||
(is (= (render "{{typename(x)}}" {:x #{1 2 3 4 5}})
|
||||
"clojure.lang.PersistentHashSet")
|
||||
"clojure.lang.LazySeq")
|
||||
"set typename via model-map")
|
||||
|
||||
; verify that the clojure function recognizes the correct types when the variable is passed via a constant
|
||||
|
@ -243,13 +243,13 @@
|
|||
"java.lang.Boolean")
|
||||
"boolean typename via constant value embedded in the template")
|
||||
(is (= (render "{{typename([1, 2, 3, 4, 5])}}" nil)
|
||||
"java.util.ArrayList")
|
||||
"clojure.lang.LazySeq")
|
||||
"list typename via constant value embedded in the template")
|
||||
(is (= (render "{{typename(1..5)}}" nil)
|
||||
"java.util.ArrayList")
|
||||
"clojure.lang.LazySeq")
|
||||
"vector typename via constant value embedded in the template")
|
||||
(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")
|
||||
|
||||
; simple passing / returning... not doing anything exciting with the arguments
|
||||
|
@ -270,16 +270,16 @@
|
|||
"true")
|
||||
"boolean via model-map")
|
||||
(is (= (render "{{identity(x)}}" {:x '(1 2 3 4 5)})
|
||||
"(1 2 3 4 5)")
|
||||
"[1, 2, 3, 4, 5]")
|
||||
"list via model-map")
|
||||
(is (= (render "{{identity(x)}}" {:x [1 2 3 4 5]})
|
||||
"[1 2 3 4 5]")
|
||||
"[1, 2, 3, 4, 5]")
|
||||
"vector via model-map")
|
||||
(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")
|
||||
(is (= (render "{{identity(x)}}" {:x #{1 2 3 4 5}})
|
||||
"#{1 2 3 4 5}")
|
||||
"[1, 2, 3, 4, 5]")
|
||||
"set via model-map")
|
||||
|
||||
; simple passing / returning... not doing anything exciting with the arguments
|
||||
|
@ -318,7 +318,7 @@
|
|||
"1 2 3 4 5 ")
|
||||
"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}})
|
||||
"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)")
|
||||
(is (= (render "{% for i in identity(x) %}{{i}} {% endfor %}" {:x #{1 2 3 4 5}})
|
||||
"1 2 3 4 5 ")
|
||||
|
|
Reference in a new issue