From f8050362e8a1c3e8480b18c91dec3d703c04dbfe Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 24 Feb 2023 00:07:19 +0100 Subject: [PATCH] net: inline ios check in tests Change-Id: I0d796d5eb05d823a18c609b2e76cc4d35da9d2b5 Reviewed-on: https://go-review.googlesource.com/c/go/+/470955 Reviewed-by: Ian Lance Taylor Reviewed-by: Cherry Mui Run-TryBot: Tobias Klauser TryBot-Result: Gopher Robot Auto-Submit: Tobias Klauser --- src/net/lookup_test.go | 10 +++++----- src/net/platform_test.go | 10 +--------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/net/lookup_test.go b/src/net/lookup_test.go index fa1a706c78..0868b1f083 100644 --- a/src/net/lookup_test.go +++ b/src/net/lookup_test.go @@ -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") } diff --git a/src/net/platform_test.go b/src/net/platform_test.go index c522ba2829..12be367b1a 100644 --- a/src/net/platform_test.go +++ b/src/net/platform_test.go @@ -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 { -- 2.48.1