summaryrefslogtreecommitdiff
path: root/src/pkg/hash/adler32/adler32_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/hash/adler32/adler32_test.go')
-rw-r--r--src/pkg/hash/adler32/adler32_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/pkg/hash/adler32/adler32_test.go b/src/pkg/hash/adler32/adler32_test.go
index ffa5569bc..01f931c68 100644
--- a/src/pkg/hash/adler32/adler32_test.go
+++ b/src/pkg/hash/adler32/adler32_test.go
@@ -5,6 +5,7 @@
package adler32
import (
+ "bytes"
"io"
"testing"
)
@@ -61,3 +62,16 @@ func TestGolden(t *testing.T) {
}
}
}
+
+func BenchmarkGolden(b *testing.B) {
+ b.StopTimer()
+ c := New()
+ var buf bytes.Buffer
+ for _, g := range golden {
+ buf.Write([]byte(g.in))
+ }
+ b.StartTimer()
+ for i := 0; i < b.N; i++ {
+ c.Write(buf.Bytes())
+ }
+}