Skip to content

Commit 60c41d1

Browse files
cixtormdlayher
authored andcommitted
internal/netreflect: more use of internal/nettest package
Change-Id: I4473e69bbb445ab27554f2dc625d0cbd79d7cfe5 Reviewed-on: https://go-review.googlesource.com/35072 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matt Layher <mdlayher@gmail.com>
1 parent db8e241 commit 60c41d1

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

internal/netreflect/socket_test.go

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package netreflect_test
77
import (
88
"net"
99
"os"
10-
"runtime"
1110
"testing"
1211

1312
"golang.org/x/net/internal/netreflect"
@@ -16,17 +15,8 @@ import (
1615

1716
func TestSocketOf(t *testing.T) {
1817
for _, network := range []string{"tcp", "unix", "unixpacket"} {
19-
switch runtime.GOOS {
20-
case "darwin":
21-
if network == "unixpacket" {
22-
continue
23-
}
24-
case "nacl", "plan9":
18+
if !nettest.TestableNetwork(network) {
2519
continue
26-
case "windows":
27-
if network == "unix" || network == "unixpacket" {
28-
continue
29-
}
3020
}
3121
ln, err := nettest.NewLocalListener(network)
3222
if err != nil {
@@ -55,13 +45,8 @@ func TestSocketOf(t *testing.T) {
5545

5646
func TestPacketSocketOf(t *testing.T) {
5747
for _, network := range []string{"udp", "unixgram"} {
58-
switch runtime.GOOS {
59-
case "nacl", "plan9":
48+
if !nettest.TestableNetwork(network) {
6049
continue
61-
case "windows":
62-
if network == "unixgram" {
63-
continue
64-
}
6550
}
6651
c, err := nettest.NewLocalPacketListener(network)
6752
if err != nil {

0 commit comments

Comments
 (0)