Skip to content

Commit be4b63b

Browse files
authored
test: minor test cleanup (#5679)
1 parent d83070e commit be4b63b

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

Diff for: test/authority_test.go

+10-11
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,11 @@ type authorityTest struct {
9898

9999
var authorityTests = []authorityTest{
100100
{
101-
name: "UnixRelative",
102-
address: "sock.sock",
103-
target: "unix:sock.sock",
104-
authority: "localhost",
101+
name: "UnixRelative",
102+
address: "sock.sock",
103+
target: "unix:sock.sock",
104+
authority: "localhost",
105+
dialTargetWant: "unix:sock.sock",
105106
},
106107
{
107108
name: "UnixAbsolute",
@@ -111,10 +112,11 @@ var authorityTests = []authorityTest{
111112
dialTargetWant: "unix:///tmp/sock.sock",
112113
},
113114
{
114-
name: "UnixAbsoluteAlternate",
115-
address: "/tmp/sock.sock",
116-
target: "unix:///tmp/sock.sock",
117-
authority: "localhost",
115+
name: "UnixAbsoluteAlternate",
116+
address: "/tmp/sock.sock",
117+
target: "unix:///tmp/sock.sock",
118+
authority: "localhost",
119+
dialTargetWant: "unix:///tmp/sock.sock",
118120
},
119121
{
120122
name: "UnixPassthrough",
@@ -148,9 +150,6 @@ func (s) TestUnix(t *testing.T) {
148150
func (s) TestUnixCustomDialer(t *testing.T) {
149151
for _, test := range authorityTests {
150152
t.Run(test.name+"WithDialer", func(t *testing.T) {
151-
if test.dialTargetWant == "" {
152-
test.dialTargetWant = test.target
153-
}
154153
dialer := func(ctx context.Context, address string) (net.Conn, error) {
155154
if address != test.dialTargetWant {
156155
return nil, fmt.Errorf("expected target %v in custom dialer, instead got %v", test.dialTargetWant, address)

0 commit comments

Comments
 (0)