From 4f780a01f9912bde9a4353d3a0dde42b0d7b0efb Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 22 Jan 2017 22:09:56 +0100 Subject: [PATCH] Index: Test pack ID --- src/restic/index/index_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/restic/index/index_test.go b/src/restic/index/index_test.go index 030789328..370625faf 100644 --- a/src/restic/index/index_test.go +++ b/src/restic/index/index_test.go @@ -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) + } } }