MCPcopy
hub / github.com/gin-gonic/gin / TestResponseWriterHijack

Function TestResponseWriterHijack

response_writer_test.go:110–127  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

108}
109
110func TestResponseWriterHijack(t *testing.T) {
111 testWriter := httptest.NewRecorder()
112 writer := &responseWriter{}
113 writer.reset(testWriter)
114 w := ResponseWriter(writer)
115
116 assert.Panics(t, func() {
117 _, _, err := w.Hijack()
118 require.NoError(t, err)
119 })
120 assert.True(t, w.Written())
121
122 assert.Panics(t, func() {
123 w.CloseNotify()
124 })
125
126 w.Flush()
127}
128
129type mockHijacker struct {
130 *httptest.ResponseRecorder

Callers

nothing calls this directly

Calls 6

resetMethod · 0.95
ResponseWriterInterface · 0.85
FlushMethod · 0.80
WrittenMethod · 0.65
HijackMethod · 0.45
CloseNotifyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…