MCPcopy
hub / github.com/olahol/melody / TestHandleError

Function TestHandleError

melody_test.go:452–471  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

450}
451
452func TestHandleError(t *testing.T) {
453 done := make(chan bool)
454
455 ws := NewTestServer()
456
457 ws.m.HandleError(func(s *Session, err error) {
458 var closeError *websocket.CloseError
459 assert.ErrorAs(t, err, &closeError)
460 close(done)
461 })
462
463 server := httptest.NewServer(ws)
464 defer server.Close()
465
466 conn := MustNewDialer(server.URL)
467
468 conn.Close()
469
470 <-done
471}
472
473func TestHandleErrorWrite(t *testing.T) {
474 writeError := make(chan struct{})

Callers

nothing calls this directly

Calls 4

NewTestServerFunction · 0.85
MustNewDialerFunction · 0.85
HandleErrorMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…