testing: support b.SetBytes(); implement sub-benchmarks.

This commit is contained in:
Dan Kegel
2022-01-07 20:32:23 -08:00
committed by Ron Evans
parent 29f7ebc63e
commit f80efa5b8b
4 changed files with 156 additions and 20 deletions
+5
View File
@@ -48,3 +48,8 @@ func TestBenchmark(t *testing.T) {
t.Errorf("Expected speedup >= 0.3, got %f", speedup)
}
}
func BenchmarkSub(b *testing.B) {
b.Run("Fast", func(b *testing.B) { BenchmarkFastNonASCII(b) })
b.Run("Slow", func(b *testing.B) { BenchmarkSlowNonASCII(b) })
}