Skip to content

Commit

Permalink
[release-branch.go1.10] net: pass if at least one matching entry in T…
Browse files Browse the repository at this point in the history
…estLookupGmailTXT

Updates #29698
Fixes #29699

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>
(cherry picked from commit 7cbfa55)
Reviewed-on: https://go-review.googlesource.com/c/157640
  • Loading branch information
ianlancetaylor committed Jan 14, 2019
1 parent f5ff72d commit c731a7d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/net/lookup_test.go
Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit c731a7d

Please sign in to comment.