summaryrefslogtreecommitdiff
path: root/test/ruuter
diff options
context:
space:
mode:
authorAsko Nõmm <asko@nmm.ee>2025-06-26 12:17:41 +0300
committerAsko Nõmm <asko@nmm.ee>2025-06-26 12:17:41 +0300
commita28282be6219b252dd046733353755d7f6e75d6b (patch)
tree57e823c9e8239ed8f41e5d06835823ef3e035ad0 /test/ruuter
parentdd8060ba529a23197fb3773841263498077d7993 (diff)
Fix #7
Diffstat (limited to 'test/ruuter')
-rw-r--r--test/ruuter/core_test.cljc13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/ruuter/core_test.cljc b/test/ruuter/core_test.cljc
index 7464fe0..3b7d478 100644
--- a/test/ruuter/core_test.cljc
+++ b/test/ruuter/core_test.cljc
@@ -30,7 +30,18 @@
(testfn "/hello/:who?/:why?" "/hello/world"))))
(testing "Wildcard param"
(is (= {:everything "this/means/literally/everything"}
- (testfn "/hello/:everything*" "/hello/this/means/literally/everything"))))))
+ (testfn "/hello/:everything*" "/hello/this/means/literally/everything"))))
+ (testing "Normal params and wildcard param in the end"
+ (is (= {:id "123"
+ :path "foo.txt"}
+ (testfn "/user/:id/file/:path*" "/user/123/file/foo.txt")))
+ (is (= {:id "123"
+ :path "a/b/c/foo.txt"}
+ (testfn "/user/:id/file/:path*" "/user/123/file/a/b/c/foo.txt")))
+ (is (= {:id "123"
+ :path "a/b/c/foo.txt"
+ :sub-path "b/c/foo.txt"}
+ (testfn "/user/:id/file/:path*/:sub-path*" "/user/123/file/a/b/c/foo.txt"))))))
(deftest match-route-test
(let [testfn #'ruuter/match-route]