mirror of
https://github.com/octoleo/restic.git
synced 2025-01-10 01:37:48 +00:00
Add BenchmarkDecodeIndex
This commit is contained in:
parent
e571b6a656
commit
e463587bad
@ -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 New Issue
Block a user