From de381d7cd9c2e30c12738cc15e45520554995dd4 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Fri, 30 Sep 2022 09:56:30 -0700 Subject: [PATCH] test: minor test cleanup --- test/authority_test.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/test/authority_test.go b/test/authority_test.go index 8148cd2347ea..c841c64736fb 100644 --- a/test/authority_test.go +++ b/test/authority_test.go @@ -98,10 +98,11 @@ type authorityTest struct { var authorityTests = []authorityTest{ { - name: "UnixRelative", - address: "sock.sock", - target: "unix:sock.sock", - authority: "localhost", + name: "UnixRelative", + address: "sock.sock", + target: "unix:sock.sock", + authority: "localhost", + dialTargetWant: "unix:sock.sock", }, { name: "UnixAbsolute", @@ -111,10 +112,11 @@ var authorityTests = []authorityTest{ dialTargetWant: "unix:///tmp/sock.sock", }, { - name: "UnixAbsoluteAlternate", - address: "/tmp/sock.sock", - target: "unix:///tmp/sock.sock", - authority: "localhost", + name: "UnixAbsoluteAlternate", + address: "/tmp/sock.sock", + target: "unix:///tmp/sock.sock", + authority: "localhost", + dialTargetWant: "unix:///tmp/sock.sock", }, { name: "UnixPassthrough", @@ -148,9 +150,6 @@ func (s) TestUnix(t *testing.T) { func (s) TestUnixCustomDialer(t *testing.T) { for _, test := range authorityTests { t.Run(test.name+"WithDialer", func(t *testing.T) { - if test.dialTargetWant == "" { - test.dialTargetWant = test.target - } dialer := func(ctx context.Context, address string) (net.Conn, error) { if address != test.dialTargetWant { return nil, fmt.Errorf("expected target %v in custom dialer, instead got %v", test.dialTargetWant, address)