mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-24 02:32:17 +08:00
fix(test): rename field
This commit is contained in:
parent
5eeff25ec3
commit
bf27dc6e96
@ -356,9 +356,9 @@ func TestRouterNotFound(t *testing.T) {
|
|||||||
router.GET("/", func(c *Context) {})
|
router.GET("/", func(c *Context) {})
|
||||||
|
|
||||||
testRoutes := []struct {
|
testRoutes := []struct {
|
||||||
route string
|
route string
|
||||||
code int
|
code int
|
||||||
header string
|
Location string
|
||||||
}{
|
}{
|
||||||
{"/path/", 301, "/path"}, // TSR -/
|
{"/path/", 301, "/path"}, // TSR -/
|
||||||
{"/dir", 301, "/dir/"}, // TSR +/
|
{"/dir", 301, "/dir/"}, // TSR +/
|
||||||
@ -374,7 +374,7 @@ func TestRouterNotFound(t *testing.T) {
|
|||||||
w := performRequest(router, "GET", tr.route)
|
w := performRequest(router, "GET", tr.route)
|
||||||
assert.Equal(t, w.Code, tr.code)
|
assert.Equal(t, w.Code, tr.code)
|
||||||
if w.Code != 404 {
|
if w.Code != 404 {
|
||||||
assert.Equal(t, fmt.Sprint(w.Header().Get("Location")), tr.header)
|
assert.Equal(t, fmt.Sprint(w.Header().Get("Location")), tr.Location)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user