(t *testing.T)
| 284 | } |
| 285 | |
| 286 | func TestDialerConnectTLSHonorsContext(t *testing.T) { |
| 287 | config := tlsConfig(t) |
| 288 | d := &Dialer{ |
| 289 | TLS: config, |
| 290 | } |
| 291 | |
| 292 | conn := &MockConn{ |
| 293 | done: make(chan struct{}), |
| 294 | } |
| 295 | |
| 296 | ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*25) |
| 297 | defer cancel() |
| 298 | |
| 299 | _, err := d.connectTLS(ctx, conn, d.TLS) |
| 300 | if !errors.Is(err, context.DeadlineExceeded) { |
| 301 | t.Errorf("expected err to be %v; got %v", context.DeadlineExceeded, err) |
| 302 | t.FailNow() |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | func TestDialerResolver(t *testing.T) { |
| 307 | ctx := context.TODO() |
nothing calls this directly
no test coverage detected