(t *testing.T)
| 1324 | } |
| 1325 | |
| 1326 | func TestContext_Bind(t *testing.T) { |
| 1327 | e := New() |
| 1328 | req := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(userJSON)) |
| 1329 | c := e.NewContext(req, nil) |
| 1330 | u := new(user) |
| 1331 | |
| 1332 | req.Header.Add(HeaderContentType, MIMEApplicationJSON) |
| 1333 | err := c.Bind(u) |
| 1334 | assert.NoError(t, err) |
| 1335 | assert.Equal(t, &user{ID: 1, Name: "Jon Snow"}, u) |
| 1336 | } |
| 1337 | |
| 1338 | func TestContext_RealIP(t *testing.T) { |
| 1339 | _, ipv6ForRemoteAddrExternalRange, _ := net.ParseCIDR("2001:db8::/64") |
nothing calls this directly
no test coverage detected
searching dependent graphs…