mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 16:31:11 +00:00
Support also booleans, more tests
This commit is contained in:
parent
5ef30443ef
commit
f547576a44
2 changed files with 21 additions and 3 deletions
|
|
@ -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))
|
||||||
|
|
|
||||||
|
|
@ -23,18 +23,32 @@
|
||||||
impl/into-string
|
impl/into-string
|
||||||
impl/url-encode)))
|
impl/url-encode)))
|
||||||
(is (= "reitit.impl-test/kikka" (-> ::kikka
|
(is (= "reitit.impl-test/kikka" (-> ::kikka
|
||||||
impl/into-string
|
impl/into-string
|
||||||
impl/url-encode
|
impl/url-encode
|
||||||
impl/url-decode))))
|
impl/url-decode))))
|
||||||
|
|
||||||
(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}))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue