From 98e93175c1247d55453aaa82b54658e1aa785f3b Mon Sep 17 00:00:00 2001 From: Ross Wolf <31489089+rw-access@users.noreply.github.com> Date: Sun, 21 Mar 2021 17:38:08 -0600 Subject: [PATCH] Add missing TestCatchAllAfterSlash test --- tree_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tree_test.go b/tree_test.go index 36db705c..032fd14f 100644 --- a/tree_test.go +++ b/tree_test.go @@ -247,10 +247,10 @@ func TestTreeWildcardConflict(t *testing.T) { {"/src/foo/bar", true}, {"/src1/", false}, {"/src1/*filepath", true}, - {"/src2/*filepath", false}, {"/src2*filepath", true}, + {"/src2/*filepath", false}, {"/search/:query", false}, - {"/search/invalid", false}, + {"/search/valid", false}, {"/user_:name", false}, {"/user_x", false}, {"/user_:name", false}, @@ -260,6 +260,13 @@ func TestTreeWildcardConflict(t *testing.T) { testRoutes(t, routes) } +func TestCatchAllAfterSlash(t *testing.T) { + routes := []testRoute{ + {"/non-leading-*catchall", true}, + } + testRoutes(t, routes) +} + func TestTreeChildConflict(t *testing.T) { routes := []testRoute{ {"/cmd/vet", false}, @@ -689,6 +696,7 @@ func TestTreeWildcardConflictEx(t *testing.T) { {"/who/are/foo", "/foo", `/who/are/\*you`, `/\*you`}, {"/who/are/foo/", "/foo/", `/who/are/\*you`, `/\*you`}, {"/who/are/foo/bar", "/foo/bar", `/who/are/\*you`, `/\*you`}, + {"/con:nection", ":nection", `/con:tact`, `:tact`}, } for i := range conflicts {