Index: Test pack ID

This commit is contained in:
Alexander Neumann 2017-01-22 22:09:56 +01:00
parent dc6a832cc3
commit 4f780a01f9
1 changed files with 6 additions and 1 deletions

View File

@ -27,9 +27,14 @@ func createFilledRepo(t testing.TB, snapshots int, dup float32) (restic.Reposito
func validateIndex(t testing.TB, repo restic.Repository, idx *Index) {
for id := range repo.List(restic.DataFile, nil) {
if _, ok := idx.Packs[id]; !ok {
p, ok := idx.Packs[id]
if !ok {
t.Errorf("pack %v missing from index", id.Str())
}
if !p.ID.Equal(id) {
t.Errorf("pack %v has invalid ID: want %v, got %v", id.Str(), id, p.ID)
}
}
}