aboutsummaryrefslogtreecommitdiff
path: root/src/net/lookup_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/lookup_test.go')
-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 24787ccf2b..01901e6217 100644
--- a/src/net/lookup_test.go
+++ b/src/net/lookup_test.go
@@ -184,11 +184,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)
+ }
}
}