From f1bc181c5b1fa54e22969d3348c9bf6e2fcd23f9 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Mon, 1 Aug 2016 21:12:23 +0200 Subject: [PATCH] Add more checks for tests --- src/restic/checker/testing.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/restic/checker/testing.go b/src/restic/checker/testing.go index a2ac3345d..3bf9aa2ec 100644 --- a/src/restic/checker/testing.go +++ b/src/restic/checker/testing.go @@ -20,13 +20,30 @@ func TestCheckRepo(t testing.TB, repo *repository.Repository) { done := make(chan struct{}) defer close(done) + + // packs errChan := make(chan error) + go chkr.Packs(errChan, done) + + for err := range errChan { + t.Error(err) + } + + // structure + errChan = make(chan error) go chkr.Structure(errChan, done) for err := range errChan { t.Error(err) } + // unused blobs + blobs := chkr.UnusedBlobs() + if len(blobs) > 0 { + t.Errorf("unused blobs found: %v", blobs) + } + + // read data errChan = make(chan error) go chkr.ReadData(nil, errChan, done)