]> Cypherpunks repositories - gostls13.git/commitdiff
net: inline ios check in tests
authorTobias Klauser <tklauser@distanz.ch>
Thu, 23 Feb 2023 23:07:19 +0000 (00:07 +0100)
committerGopher Robot <gobot@golang.org>
Fri, 24 Feb 2023 20:25:59 +0000 (20:25 +0000)
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>

src/net/lookup_test.go
src/net/platform_test.go

index fa1a706c782afecbeab737aca885f05494cf72d9..0868b1f083aff654e608ea6027578cb65d3281ff 100644 (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")
        }
 
index c522ba282915b0c729e52e76c5dd780ddf276328..12be367b1a41a4bdfdfaba7132b7dbf635fd5ea2 100644 (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 {