net: inline ios check in tests

Change-Id: I0d796d5eb05d823a18c609b2e76cc4d35da9d2b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/470955
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
Tobias Klauser 2023-02-24 00:07:19 +01:00 committed by Gopher Robot
parent 00adc54218
commit f8050362e8
2 changed files with 6 additions and 14 deletions

View File

@ -74,7 +74,7 @@ func TestLookupGoogleSRV(t *testing.T) {
t.Parallel()
mustHaveExternalNetwork(t)
if iOS() {
if runtime.GOOS == "ios" {
t.Skip("no resolv.conf on iOS")
}
@ -123,7 +123,7 @@ func TestLookupGmailMX(t *testing.T) {
t.Parallel()
mustHaveExternalNetwork(t)
if iOS() {
if runtime.GOOS == "ios" {
t.Skip("no resolv.conf on iOS")
}
@ -169,7 +169,7 @@ func TestLookupGmailNS(t *testing.T) {
t.Parallel()
mustHaveExternalNetwork(t)
if iOS() {
if runtime.GOOS == "ios" {
t.Skip("no resolv.conf on iOS")
}
@ -218,7 +218,7 @@ func TestLookupGmailTXT(t *testing.T) {
t.Parallel()
mustHaveExternalNetwork(t)
if iOS() {
if runtime.GOOS == "ios" {
t.Skip("no resolv.conf on iOS")
}
@ -643,7 +643,7 @@ func TestLookupDotsWithRemoteSource(t *testing.T) {
t.Skip("IPv4 is required")
}
if iOS() {
if runtime.GOOS == "ios" {
t.Skip("no resolv.conf on iOS")
}

View File

@ -48,15 +48,11 @@ func testableNetwork(network string) bool {
}
case "unix", "unixgram":
switch runtime.GOOS {
case "android", "plan9", "windows":
case "android", "ios", "plan9", "windows":
return false
case "aix":
return unixEnabledOnAIX
}
// iOS does not support unix, unixgram.
if iOS() {
return false
}
case "unixpacket":
switch runtime.GOOS {
case "aix", "android", "darwin", "ios", "plan9", "windows":
@ -81,10 +77,6 @@ func testableNetwork(network string) bool {
return true
}
func iOS() bool {
return runtime.GOOS == "ios"
}
// testableAddress reports whether address of network is testable on
// the current platform configuration.
func testableAddress(network, address string) bool {