MCPcopy Index your code
hub / github.com/coder/websocket / TestCloseStatus

Function TestCloseStatus

close_test.go:171–207  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

169}
170
171func TestCloseStatus(t *testing.T) {
172 t.Parallel()
173
174 testCases := []struct {
175 name string
176 in error
177 exp StatusCode
178 }{
179 {
180 name: "nil",
181 in: nil,
182 exp: -1,
183 },
184 {
185 name: "io.EOF",
186 in: io.EOF,
187 exp: -1,
188 },
189 {
190 name: "StatusInternalError",
191 in: CloseError{
192 Code: StatusInternalError,
193 },
194 exp: StatusInternalError,
195 },
196 }
197
198 for _, tc := range testCases {
199 tc := tc
200 t.Run(tc.name, func(t *testing.T) {
201 t.Parallel()
202
203 act := CloseStatus(tc.in)
204 assert.Equal(t, "close status", tc.exp, act)
205 })
206 }
207}

Callers

nothing calls this directly

Calls 2

EqualFunction · 0.92
CloseStatusFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…