(t *testing.T)
| 664 | } |
| 665 | |
| 666 | func TestConcurrentWritePanic(t *testing.T) { |
| 667 | w := blockingWriter{make(chan struct{}), make(chan struct{})} |
| 668 | c := newTestConn(nil, w, false) |
| 669 | go func() { |
| 670 | c.WriteMessage(TextMessage, []byte{}) |
| 671 | }() |
| 672 | |
| 673 | // wait for goroutine to block in write. |
| 674 | <-w.c1 |
| 675 | |
| 676 | defer func() { |
| 677 | close(w.c2) |
| 678 | if v := recover(); v != nil { |
| 679 | return |
| 680 | } |
| 681 | }() |
| 682 | |
| 683 | c.WriteMessage(TextMessage, []byte{}) |
| 684 | t.Fatal("should not get here") |
| 685 | } |
| 686 | |
| 687 | type failingReader struct{} |
| 688 |
nothing calls this directly
no test coverage detected