aboutsummaryrefslogtreecommitdiff
path: root/src/net/platform_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/platform_test.go')
-rw-r--r--src/net/platform_test.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/net/platform_test.go b/src/net/platform_test.go
index b700091dc5..d6248520f3 100644
--- a/src/net/platform_test.go
+++ b/src/net/platform_test.go
@@ -14,7 +14,8 @@ import (
// testableNetwork reports whether network is testable on the current
// platform configuration.
func testableNetwork(network string) bool {
- switch ss := strings.Split(network, ":"); ss[0] {
+ ss := strings.Split(network, ":")
+ switch ss[0] {
case "ip+nopriv":
switch runtime.GOOS {
case "nacl":
@@ -46,6 +47,16 @@ func testableNetwork(network string) bool {
return false
}
}
+ switch ss[0] {
+ case "tcp4", "udp4", "ip4":
+ if !supportsIPv4 {
+ return false
+ }
+ case "tcp6", "udp6", "ip6":
+ if !supportsIPv6 {
+ return false
+ }
+ }
return true
}