Skip to content

Commit

Permalink
Add missing TestCatchAllAfterSlash test
Browse files Browse the repository at this point in the history
  • Loading branch information
rw-access committed Mar 21, 2021
1 parent 2d71324 commit 98e9317
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tree_test.go
Expand Up @@ -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},
Expand All @@ -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},
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 98e9317

Please sign in to comment.