]> Cypherpunks repositories - gostls13.git/commitdiff
net: don't check LookupHost error in TestLookupNullByte
authorDmitri Shuralyov <dmitshur@golang.org>
Wed, 5 Feb 2020 00:41:48 +0000 (19:41 -0500)
committerDmitri Shuralyov <dmitshur@golang.org>
Wed, 5 Feb 2020 14:32:25 +0000 (14:32 +0000)
net.LookupHost("foo\x00bar") may resolve successfully on some networks.
Reduce the scope of the test to check only that the call doesn't panic.

Also update the test comment to reference the relevant issue.

Fixes #37031
Updates #31597

Change-Id: If175deed8121625ef507598c6145e937ccffd89e
Reviewed-on: https://go-review.googlesource.com/c/go/+/217729
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/net/lookup_test.go

index 1663b78ef00d05f07b7ed4fe3663b66f35aacdf3..2bc5592d5ad730c4c5da39a57d1cc63de5b10887 100644 (file)
@@ -1179,12 +1179,9 @@ func TestWithUnexpiredValuesPreserved(t *testing.T) {
        }
 }
 
-// Issue 31586: don't crash on null byte in name
+// Issue 31597: don't panic on null byte in name
 func TestLookupNullByte(t *testing.T) {
        testenv.MustHaveExternalNetwork(t)
        testenv.SkipFlakyNet(t)
-       _, err := LookupHost("foo\x00bar") // used to crash on Windows
-       if err == nil {
-               t.Errorf("unexpected success")
-       }
+       LookupHost("foo\x00bar") // check that it doesn't panic; it used to on Windows
 }