Skip to content

Commit

Permalink
test: minor test cleanup (#5679)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley authored Oct 3, 2022
1 parent d83070e commit be4b63b
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions test/authority_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit be4b63b

Please sign in to comment.