diff options
author | Russ Cox <rsc@golang.org> | 2016-01-08 17:17:53 +0000 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2016-01-08 17:18:00 +0000 |
commit | a120beaa8db6b723c120c8d3bf3324dfa503cb2d (patch) | |
tree | 0b0556382322664869190e78aac0c1ddf96044a1 /src/net/ip_test.go | |
parent | beb1741ae380d4e196f9d6e2e720fc0dc007ef00 (diff) | |
download | go-git-a120beaa8db6b723c120c8d3bf3324dfa503cb2d.tar.gz |
Revert "net: ensure that malformed domain names report a consistent error"
This reverts commit bb8c2e19a7fe2ca2283eca44dba2047c9f4307fe.
Change-Id: I9bc089e9f2296805ef055b98e8c86ba73af30226
Reviewed-on: https://go-review.googlesource.com/18439
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/net/ip_test.go')
-rw-r--r-- | src/net/ip_test.go | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/net/ip_test.go b/src/net/ip_test.go index 69ef5a1ae5..3d95a73c09 100644 --- a/src/net/ip_test.go +++ b/src/net/ip_test.go @@ -540,48 +540,3 @@ func TestIPAddrScope(t *testing.T) { } } } - -func TestLookupBadName(t *testing.T) { - // Check that we get the same error for invalid names regardless of lookup algorithm. - - mode := "" - check := func(fn string, err error) { - if e, ok := err.(*DNSError); !ok || e.Err != "invalid domain name" { - t.Errorf("%s: %s(\"!!!.local\") = %T(%v), want DNSError(invalid domain name)", mode, fn, err, err) - } - } - - for i, fn := range []func() func(){forceGoDNS, forceCgoDNS} { - fixup := fn() - if fixup == nil { - continue - } - mode = "netgo" - if i == 1 { - mode = "netcgo" - } - - _, err := LookupHost("!!!.local") - check("LookupHost", err) - - _, err = LookupIP("!!!.local") - check("LookupIP", err) - - _, err = LookupCNAME("!!!.local") - check("LookupCNAME", err) - - _, _, err = LookupSRV("x", "tcp", "!!!.local") - check("LookupSRV", err) - - _, err = LookupMX("!!!.local") - check("LookupMX", err) - - _, err = LookupNS("!!!.local") - check("LookupNS", err) - - _, err = LookupTXT("!!!.local") - check("LookupTXT", err) - - fixup() - } -} |