net: remove duplicate error information in Dial

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5293045
This commit is contained in:
Andrey Mirtchovski 2011-10-18 14:51:40 -04:00 committed by Russ Cox
parent 48bb3e8f28
commit 565793996c
2 changed files with 8 additions and 2 deletions

View file

@ -62,6 +62,8 @@ var dialErrorTests = []DialErrorTest{
},
}
var duplicateErrorPattern = `dial (.*) dial (.*)`
func TestDialError(t *testing.T) {
if !*runErrorTest {
t.Logf("test disabled; use --run_error_test to enable")
@ -81,6 +83,10 @@ func TestDialError(t *testing.T) {
if !match {
t.Errorf("#%d: %q, want match for %#q", i, s, tt.Pattern)
}
match, _ = regexp.MatchString(duplicateErrorPattern, s)
if match {
t.Errorf("#%d: %q, duplicate error return from Dial", i, s)
}
}
}