mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 16:31:11 +00:00
.
This commit is contained in:
parent
5bd933a10c
commit
433cf9102d
1 changed files with 12 additions and 0 deletions
12
test/cljc/reitit/segment_test.cljc
Normal file
12
test/cljc/reitit/segment_test.cljc
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
(ns reitit.segment-test
|
||||||
|
(:require [clojure.test :refer [deftest testing is are]]
|
||||||
|
[reitit.segment :as s]))
|
||||||
|
|
||||||
|
(-> (s/insert nil "/foo" {:a 1}) (s/compile) (s/lookup "/foo"))
|
||||||
|
; => #reitit.segment.Match{:data {:a 1}, :path-params {}}
|
||||||
|
|
||||||
|
(-> (s/insert nil "/foo" {:a 1}) (s/insert "/foo/*" {:b 1}) (s/compile) (s/lookup "/foo"))
|
||||||
|
; => nil
|
||||||
|
|
||||||
|
(-> (s/insert nil "/foo" {:a 1}) (s/insert "/foo/*" {:b 1}) (s/compile) (s/lookup "/foo/bar"))
|
||||||
|
; => #reitit.segment.Match{:data {:b 1}, :path-params {: "bar"}}
|
||||||
Loading…
Reference in a new issue