mirror of
https://github.com/golang/go
synced 2024-11-24 00:20:14 -07:00
net/url: don't assume b.N > 0
Change-Id: Ie79c16d6e61b3baa274069528cf883b22fd255fe Reviewed-on: https://go-review.googlesource.com/20855 Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
d3ce412fa5
commit
3e2e80599e
@ -611,7 +611,7 @@ func BenchmarkString(b *testing.B) {
|
||||
g = u.String()
|
||||
}
|
||||
b.StopTimer()
|
||||
if w := tt.roundtrip; g != w {
|
||||
if w := tt.roundtrip; b.N > 0 && g != w {
|
||||
b.Errorf("Parse(%q).String() == %q, want %q", tt.in, g, w)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user