(t *testing.T)
| 405 | } |
| 406 | |
| 407 | func TestWithHTTPClient(t *testing.T) { |
| 408 | cookieJar, err := cookiejar.New(nil) |
| 409 | assert.NilError(t, err) |
| 410 | pristineHTTPClient := func() *http.Client { |
| 411 | return &http.Client{ |
| 412 | Timeout: 42 * time.Second, |
| 413 | Jar: cookieJar, |
| 414 | Transport: &http.Transport{ |
| 415 | TLSClientConfig: &tls.Config{ServerName: "example.com", MinVersion: tls.VersionTLS12}, |
| 416 | }, |
| 417 | } |
| 418 | } |
| 419 | hc := pristineHTTPClient() |
| 420 | _, err = New(WithHTTPClient(hc), WithHost("tcp://example.com:443")) |
| 421 | assert.NilError(t, err) |
| 422 | assert.DeepEqual(t, hc, pristineHTTPClient(), |
| 423 | cmpopts.IgnoreUnexported(http.Transport{}, tls.Config{}), |
| 424 | cmpopts.EquateComparable(&cookiejar.Jar{})) |
| 425 | } |
| 426 | |
| 427 | func TestWithResponseHook(t *testing.T) { |
| 428 | const hdrKey = "X-Test-Header" |
nothing calls this directly
no test coverage detected
searching dependent graphs…