MCPcopy
hub / github.com/coder/websocket / wstestCaseCount

Function wstestCaseCount

autobahn_test.go:210–235  ·  view source on GitHub ↗
(ctx context.Context, url string)

Source from the content-addressed store, hash-verified

208}
209
210func wstestCaseCount(ctx context.Context, url string) (cases int, err error) {
211 defer errd.Wrap(&err, "failed to get case count")
212
213 c, _, err := websocket.Dial(ctx, url+"/getCaseCount", nil)
214 if err != nil {
215 return 0, err
216 }
217 defer c.Close(websocket.StatusInternalError, "")
218
219 _, r, err := c.Reader(ctx)
220 if err != nil {
221 return 0, err
222 }
223 b, err := io.ReadAll(r)
224 if err != nil {
225 return 0, err
226 }
227 cases, err = strconv.Atoi(string(b))
228 if err != nil {
229 return 0, err
230 }
231
232 c.Close(websocket.StatusNormalClosure, "")
233
234 return cases, nil
235}
236
237func checkWSTestIndex(t *testing.T, path string) {
238 wstestOut, err := os.ReadFile(path)

Callers 1

TestAutobahnFunction · 0.85

Calls 4

WrapFunction · 0.92
DialFunction · 0.92
CloseMethod · 0.45
ReaderMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…