(t *testing.T)
| 450 | } |
| 451 | |
| 452 | func 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 | |
| 473 | func TestHandleErrorWrite(t *testing.T) { |
| 474 | writeError := make(chan struct{}) |
nothing calls this directly
no test coverage detected
searching dependent graphs…