mirror of
https://github.com/metosin/reitit.git
synced 2026-01-30 17:50:33 +00:00
Emoji routing
This commit is contained in:
parent
d0cfdf304a
commit
aea8a8f2d5
1 changed files with 2 additions and 0 deletions
|
|
@ -102,6 +102,7 @@
|
||||||
["/files/file-{name}.html" ::html]
|
["/files/file-{name}.html" ::html]
|
||||||
["/files/file-{name}.json" ::json]
|
["/files/file-{name}.json" ::json]
|
||||||
["/{eskon}/{saum}/pium\u2215paum" ::loru]
|
["/{eskon}/{saum}/pium\u2215paum" ::loru]
|
||||||
|
["/{🌈}🤔/🎈" ::emoji]
|
||||||
["/extra-end}s-are/ok" ::bracket]]
|
["/extra-end}s-are/ok" ::bracket]]
|
||||||
{:router r})
|
{:router r})
|
||||||
by-path #(-> router (r/match-by-path %) ((juxt (comp :name :data) :path-params)))]
|
by-path #(-> router (r/match-by-path %) ((juxt (comp :name :data) :path-params)))]
|
||||||
|
|
@ -121,6 +122,7 @@
|
||||||
(is (= [::html {:name "10"}] (by-path "/files/file-10.html")))
|
(is (= [::html {:name "10"}] (by-path "/files/file-10.html")))
|
||||||
(is (= [::loru {:eskon "viitan", :saum "aa"}] (by-path "/viitan/aa/pium\u2215paum")))
|
(is (= [::loru {:eskon "viitan", :saum "aa"}] (by-path "/viitan/aa/pium\u2215paum")))
|
||||||
(is (= [nil nil] (by-path "/ei/osu/pium/paum")))
|
(is (= [nil nil] (by-path "/ei/osu/pium/paum")))
|
||||||
|
(is (= [::emoji {:🌈 "brackets"}] (by-path "/brackets🤔/🎈")))
|
||||||
(is (= [::bracket {}] (by-path "/extra-end}s-are/ok")))))
|
(is (= [::bracket {}] (by-path "/extra-end}s-are/ok")))))
|
||||||
|
|
||||||
(testing "invalid syntax fails fast"
|
(testing "invalid syntax fails fast"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue