Support also booleans, more tests

This commit is contained in:
Tommi Reiman 2018-03-21 07:48:56 +02:00
parent 5ef30443ef
commit f547576a44
2 changed files with 21 additions and 3 deletions

View file

@ -187,6 +187,10 @@
(when (namespace this) "/") (when (namespace this) "/")
(name this))) (name this)))
#?(:clj Boolean
:cljs boolean)
(into-string [this] (str this))
#?(:clj Number #?(:clj Number
:cljs number) :cljs number)
(into-string [this] (str this)) (into-string [this] (str this))

View file

@ -29,12 +29,26 @@
(deftest path-params-test (deftest path-params-test
(is (= {:n "1" (is (= {:n "1"
:n1 "-1"
:n2 "1"
:n3 "1"
:n4 "1"
:n5 "1"
:d "2.2" :d "2.2"
:b "true"
:s "kikka" :s "kikka"
:u "c2541900-17a7-4353-9024-db8ac258ba4e"
:k "kikka" :k "kikka"
:qk "reitit.impl-test%2Fkikka"} :qk "reitit.impl-test%2Fkikka"}
(impl/path-params {:n 1 (impl/path-params {:n 1
:n1 -1
:n2 (long 1)
:n3 (int 1)
:n4 (short 1)
:n5 (byte 1)
:d 2.2 :d 2.2
:b true
:s "kikka" :s "kikka"
:u #uuid "c2541900-17a7-4353-9024-db8ac258ba4e"
:k :kikka :k :kikka
:qk ::kikka})))) :qk ::kikka}))))