|
|
|
@ -588,6 +588,24 @@ func TestQueries(t *testing.T) { |
|
|
|
path: "", |
|
|
|
path: "", |
|
|
|
shouldMatch: false, |
|
|
|
shouldMatch: false, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: "Queries route with empty value, should match", |
|
|
|
|
|
|
|
route: new(Route).Queries("foo", ""), |
|
|
|
|
|
|
|
request: newRequest("GET", "http://localhost?foo=bar"), |
|
|
|
|
|
|
|
vars: map[string]string{}, |
|
|
|
|
|
|
|
host: "", |
|
|
|
|
|
|
|
path: "", |
|
|
|
|
|
|
|
shouldMatch: true, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: "Queries route with overlapping value, should not match", |
|
|
|
|
|
|
|
route: new(Route).Queries("foo", "bar"), |
|
|
|
|
|
|
|
request: newRequest("GET", "http://localhost?foo=barfoo"), |
|
|
|
|
|
|
|
vars: map[string]string{}, |
|
|
|
|
|
|
|
host: "", |
|
|
|
|
|
|
|
path: "", |
|
|
|
|
|
|
|
shouldMatch: false, |
|
|
|
|
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for _, test := range tests { |
|
|
|
for _, test := range tests { |
|
|
|
|