mirror of
https://github.com/metosin/reitit.git
synced 2025-12-28 12:18:25 +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}.json" ::json]
|
||||
["/{eskon}/{saum}/pium\u2215paum" ::loru]
|
||||
["/{🌈}🤔/🎈" ::emoji]
|
||||
["/extra-end}s-are/ok" ::bracket]]
|
||||
{:router r})
|
||||
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 (= [::loru {:eskon "viitan", :saum "aa"}] (by-path "/viitan/aa/pium\u2215paum")))
|
||||
(is (= [nil nil] (by-path "/ei/osu/pium/paum")))
|
||||
(is (= [::emoji {:🌈 "brackets"}] (by-path "/brackets🤔/🎈")))
|
||||
(is (= [::bracket {}] (by-path "/extra-end}s-are/ok")))))
|
||||
|
||||
(testing "invalid syntax fails fast"
|
||||
|
|
|
|||
Loading…
Reference in a new issue