(t *testing.T)
| 3326 | } |
| 3327 | |
| 3328 | func TestCreateTestContextWithRouteParams(t *testing.T) { |
| 3329 | w := httptest.NewRecorder() |
| 3330 | engine := New() |
| 3331 | engine.GET("/:action/:name", func(ctx *Context) { |
| 3332 | ctx.String(http.StatusOK, "%s %s", ctx.Param("action"), ctx.Param("name")) |
| 3333 | }) |
| 3334 | c := CreateTestContextOnly(w, engine) |
| 3335 | c.Request, _ = http.NewRequest(http.MethodGet, "/hello/gin", nil) |
| 3336 | engine.HandleContext(c) |
| 3337 | |
| 3338 | assert.Equal(t, http.StatusOK, w.Code) |
| 3339 | assert.Equal(t, "hello gin", w.Body.String()) |
| 3340 | } |
| 3341 | |
| 3342 | type interceptedWriter struct { |
| 3343 | ResponseWriter |
nothing calls this directly
no test coverage detected