Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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