(t *testing.T)
| 558 | } |
| 559 | |
| 560 | func TestConnectCustomDialer(t *testing.T) { |
| 561 | t.Parallel() |
| 562 | |
| 563 | ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) |
| 564 | defer cancel() |
| 565 | |
| 566 | config, err := pgconn.ParseConfig(os.Getenv("PGX_TEST_DATABASE")) |
| 567 | require.NoError(t, err) |
| 568 | |
| 569 | dialed := false |
| 570 | config.DialFunc = func(ctx context.Context, network, address string) (net.Conn, error) { |
| 571 | dialed = true |
| 572 | return net.Dial(network, address) |
| 573 | } |
| 574 | |
| 575 | conn, err := pgconn.ConnectConfig(ctx, config) |
| 576 | require.NoError(t, err) |
| 577 | require.True(t, dialed) |
| 578 | closeConn(t, conn) |
| 579 | } |
| 580 | |
| 581 | func TestConnectCustomLookup(t *testing.T) { |
| 582 | t.Parallel() |
nothing calls this directly
no test coverage detected