summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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]