summaryrefslogtreecommitdiff
path: root/internal/pathtree_test.go
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-10-09 08:59:01 -0600
committertjpcc <tjp@ctrl-c.club>2023-10-09 08:59:01 -0600
commit64b06db74da3bb77c7bd703bf9124fed83c47d7f (patch)
tree6eea64f3de0358cb3e3d49010b2ff21a967cb63f /internal/pathtree_test.go
parent20be557b7bc3d7ada78411b7b279c9f7580d0bc7 (diff)
router/pathtree: support a required path segment prefix before :wildcardsv1.4.0
Diffstat (limited to 'internal/pathtree_test.go')
-rw-r--r--internal/pathtree_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/pathtree_test.go b/internal/pathtree_test.go
index e152e85..d9df757 100644
--- a/internal/pathtree_test.go
+++ b/internal/pathtree_test.go
@@ -34,6 +34,7 @@ func TestPathTree(t *testing.T) {
{"/a/b", 3},
{"/c", 4},
{"/x/:y/z/*rest", 5},
+ {"/f/prefix:y/z/*rest", 6},
},
paths: map[string]matchresult{
"/a": {
@@ -66,6 +67,13 @@ func TestPathTree(t *testing.T) {
"/": {
failed: true,
},
+ "/f/mismatch/z/more": {
+ failed: true,
+ },
+ "/f/prefixblargh/z/more": {
+ value: 6,
+ params: map[string]string{"y": "blargh", "rest": "more"},
+ },
},
},
{