Commit 3e2e8059 authored by Marcel van Lohuizen's avatar Marcel van Lohuizen Committed by Russ Cox

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: default avatarRuss Cox <rsc@golang.org>
parent d3ce412f
......@@ -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)
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment