(t *testing.T)
| 26 | ) |
| 27 | |
| 28 | func TestFillContext(t *testing.T) { |
| 29 | a := assertions.New(t) |
| 30 | |
| 31 | type ctxKeyType struct{} |
| 32 | var ctxKey ctxKeyType |
| 33 | |
| 34 | m := FillContext(func(ctx context.Context) context.Context { |
| 35 | return context.WithValue(ctx, ctxKey, "value") |
| 36 | }) |
| 37 | |
| 38 | r := httptest.NewRequest(http.MethodGet, "/", nil) |
| 39 | rec := httptest.NewRecorder() |
| 40 | m(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 41 | a.So(r.Context().Value(ctxKey), should.Equal, "value") |
| 42 | })).ServeHTTP(rec, r) |
| 43 | } |
nothing calls this directly
no test coverage detected