|
|
|
|
@ -151,6 +151,33 @@ func TestPath(t *testing.T) {
@@ -151,6 +151,33 @@ func TestPath(t *testing.T) {
|
|
|
|
|
path: "/111/222/333", |
|
|
|
|
shouldMatch: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: "Path route, match with trailing slash in request and path", |
|
|
|
|
route: new(Route).Path("/111/"), |
|
|
|
|
request: newRequest("GET", "http://localhost/111/"), |
|
|
|
|
vars: map[string]string{}, |
|
|
|
|
host: "", |
|
|
|
|
path: "/111/", |
|
|
|
|
shouldMatch: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: "Path route, do not match with trailing slash in path", |
|
|
|
|
route: new(Route).Path("/111/"), |
|
|
|
|
request: newRequest("GET", "http://localhost/111"), |
|
|
|
|
vars: map[string]string{}, |
|
|
|
|
host: "", |
|
|
|
|
path: "/111", |
|
|
|
|
shouldMatch: false, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: "Path route, do not match with trailing slash in request", |
|
|
|
|
route: new(Route).Path("/111"), |
|
|
|
|
request: newRequest("GET", "http://localhost/111/"), |
|
|
|
|
vars: map[string]string{}, |
|
|
|
|
host: "", |
|
|
|
|
path: "/111/", |
|
|
|
|
shouldMatch: false, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: "Path route, wrong path in request in request URL", |
|
|
|
|
route: new(Route).Path("/111/222/333"), |
|
|
|
|
|