]> Cypherpunks repositories - gostls13.git/commitdiff
net/url: don't assume b.N > 0
authorMarcel van Lohuizen <mpvl@golang.org>
Fri, 18 Mar 2016 15:41:38 +0000 (16:41 +0100)
committerRuss Cox <rsc@golang.org>
Fri, 18 Mar 2016 15:54:59 +0000 (15:54 +0000)
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>
src/net/url/url_test.go

index 896a5da341b35676a3e4ace55f499b53fa228e2f..7560f22c4a1e2a7f258b7d4f2f256a6e02859938 100644 (file)
@@ -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)
                }
        }