From a28282be6219b252dd046733353755d7f6e75d6b Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Thu, 26 Jun 2025 12:17:41 +0300 Subject: Fix #7 --- test/ruuter/core_test.cljc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test') 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] -- cgit v1.2.3