(t *testing.T)
| 554 | } |
| 555 | |
| 556 | func TestClosesWithError(t *testing.T) { |
| 557 | in := &proxy.Config{ |
| 558 | Addr: "127.0.0.1", |
| 559 | Port: 24014, |
| 560 | Instances: []proxy.InstanceConnConfig{ |
| 561 | {Name: "proj:reg:inst"}, |
| 562 | }, |
| 563 | } |
| 564 | c, err := proxy.NewClient(context.Background(), &errorDialer{}, testLogger, in, nil) |
| 565 | if err != nil { |
| 566 | t.Fatalf("proxy.NewClient error want = nil, got = %v", err) |
| 567 | } |
| 568 | go c.Serve(context.Background(), func() {}) |
| 569 | |
| 570 | conn := tryTCPDial(t, "127.0.0.1:24014") |
| 571 | defer conn.Close() |
| 572 | |
| 573 | if err = c.Close(); err == nil { |
| 574 | t.Fatal("c.Close() should error, got nil") |
| 575 | } |
| 576 | } |
| 577 | |
| 578 | func TestMultiErrorFormatting(t *testing.T) { |
| 579 | tcs := []struct { |
nothing calls this directly
no test coverage detected