aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2019-01-11 14:26:24 -0800
committerIan Lance Taylor <iant@golang.org>2019-01-12 00:27:48 +0000
commit7cbfa55b5d17c8deaecff05e4221f828467cfa97 (patch)
tree866409c02f79ac13ad0fc7548796ca384bf57d4f /src
parenta2bb68de4d1cb1ca35279523365e9caf36fb9896 (diff)
downloadgo-7cbfa55b5d17c8deaecff05e4221f828467cfa97.tar.xz
net: pass if at least one matching entry in TestLookupGmailTXT
Fixes #29698 Change-Id: I0531c0a274b120af8871aa2f5975744ff6c912a3 Reviewed-on: https://go-review.googlesource.com/c/157638 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/net/lookup_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/net/lookup_test.go b/src/net/lookup_test.go
index 1da0e49a28..6dc5f61728 100644
--- a/src/net/lookup_test.go
+++ b/src/net/lookup_test.go
@@ -237,11 +237,16 @@ func TestLookupGmailTXT(t *testing.T) {
if len(txts) == 0 {
t.Error("got no record")
}
+ found := false
for _, txt := range txts {
- if !strings.Contains(txt, tt.txt) || (!strings.HasSuffix(txt, tt.host) && !strings.HasSuffix(txt, tt.host+".")) {
- t.Errorf("got %s; want a record containing %s, %s", txt, tt.txt, tt.host)
+ if strings.Contains(txt, tt.txt) && (strings.HasSuffix(txt, tt.host) || strings.HasSuffix(txt, tt.host+".")) {
+ found = true
+ break
}
}
+ if !found {
+ t.Errorf("got %v; want a record containing %s, %s", txts, tt.txt, tt.host)
+ }
}
}