Skip to content

Commit c731a7d

Browse files
[release-branch.go1.10] net: pass if at least one matching entry in TestLookupGmailTXT
Updates #29698 Fixes #29699 Change-Id: I0531c0a274b120af8871aa2f5975744ff6c912a3 Reviewed-on: https://go-review.googlesource.com/c/157638 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> (cherry picked from commit 7cbfa55) Reviewed-on: https://go-review.googlesource.com/c/157640
1 parent f5ff72d commit c731a7d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/net/lookup_test.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,16 @@ func TestLookupGmailTXT(t *testing.T) {
184184
if len(txts) == 0 {
185185
t.Error("got no record")
186186
}
187+
found := false
187188
for _, txt := range txts {
188-
if !strings.Contains(txt, tt.txt) || (!strings.HasSuffix(txt, tt.host) && !strings.HasSuffix(txt, tt.host+".")) {
189-
t.Errorf("got %s; want a record containing %s, %s", txt, tt.txt, tt.host)
189+
if strings.Contains(txt, tt.txt) && (strings.HasSuffix(txt, tt.host) || strings.HasSuffix(txt, tt.host+".")) {
190+
found = true
191+
break
190192
}
191193
}
194+
if !found {
195+
t.Errorf("got %v; want a record containing %s, %s", txts, tt.txt, tt.host)
196+
}
192197
}
193198
}
194199

0 commit comments

Comments
 (0)