MCPcopy
hub / github.com/labstack/echo / TestResponse_Write_UsesSetResponseCode

Function TestResponse_Write_UsesSetResponseCode

response_test.go:43–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

41}
42
43func TestResponse_Write_UsesSetResponseCode(t *testing.T) {
44 e := New()
45 rec := httptest.NewRecorder()
46 res := NewResponse(rec, e.Logger)
47
48 res.Status = http.StatusBadRequest
49 res.Write([]byte("test"))
50 assert.Equal(t, http.StatusBadRequest, rec.Code)
51}
52
53func TestResponse_ChangeStatusCodeBeforeWrite(t *testing.T) {
54 e := New()

Callers

nothing calls this directly

Calls 3

WriteMethod · 0.95
NewFunction · 0.85
NewResponseFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…