(t *testing.T)
| 106 | } |
| 107 | |
| 108 | func TestWantConn_tryDeliver_AlreadyDone(t *testing.T) { |
| 109 | w := &wantConn{ |
| 110 | ctx: context.Background(), |
| 111 | done: true, // Already done |
| 112 | result: make(chan wantConnResult, 1), |
| 113 | } |
| 114 | |
| 115 | // Test delivery when already done |
| 116 | delivered := w.tryDeliver(&Conn{}, nil) |
| 117 | if delivered { |
| 118 | t.Error("tryDeliver() = true, want false when already done") |
| 119 | } |
| 120 | |
| 121 | // Check that no result is sent |
| 122 | select { |
| 123 | case <-w.result: |
| 124 | t.Error("No result should be sent when already done") |
| 125 | case <-time.After(time.Millisecond): |
| 126 | // Expected |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | func TestWantConn_cancel_NotDone(t *testing.T) { |
| 131 | w := &wantConn{ |
nothing calls this directly
no test coverage detected