mirror of
https://github.com/restic/restic.git
synced 2024-12-24 08:44:52 +00:00
Add BenchmarkDecodeIndex
This commit is contained in:
parent
e571b6a656
commit
e463587bad
1 changed files with 13 additions and 0 deletions
|
@ -326,6 +326,19 @@ func TestIndexUnserialize(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func BenchmarkDecodeIndex(b *testing.B) {
|
||||
rd := bytes.NewReader(docExample)
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
_, err := rd.Seek(0, 0)
|
||||
OK(b, err)
|
||||
_, err = repository.DecodeIndex(rd)
|
||||
OK(b, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIndexUnserializeOld(t *testing.T) {
|
||||
idx, err := repository.DecodeOldIndex(bytes.NewReader(docOldExample))
|
||||
OK(t, err)
|
||||
|
|
Loading…
Reference in a new issue