mirror of
https://github.com/restic/restic.git
synced 2026-06-17 22:24:17 +00:00
ui/progress: unexport NoopPrinter and add New* function
This commit is contained in:
@@ -70,10 +70,10 @@ func TestPruneMaxUnusedDuplicate(t *testing.T) {
|
||||
usedBlobs.Insert(blob)
|
||||
}
|
||||
return nil
|
||||
}, &progress.NoopPrinter{})
|
||||
}, progress.NewNoopPrinter())
|
||||
rtest.OK(t, err)
|
||||
|
||||
rtest.OK(t, plan.Execute(context.TODO(), &progress.NoopPrinter{}))
|
||||
rtest.OK(t, plan.Execute(context.TODO(), progress.NewNoopPrinter()))
|
||||
|
||||
rsize := plan.Stats().Size
|
||||
remainingUnusedSize := rsize.Duplicate + rsize.Unused - rsize.Remove - rsize.Repackrm
|
||||
|
||||
@@ -41,10 +41,10 @@ func testPrune(t *testing.T, opts repository.PruneOptions, errOnUnused bool) {
|
||||
usedBlobs.Insert(blob)
|
||||
}
|
||||
return nil
|
||||
}, &progress.NoopPrinter{})
|
||||
}, progress.NewNoopPrinter())
|
||||
rtest.OK(t, err)
|
||||
|
||||
rtest.OK(t, plan.Execute(context.TODO(), &progress.NoopPrinter{}))
|
||||
rtest.OK(t, plan.Execute(context.TODO(), progress.NewNoopPrinter()))
|
||||
|
||||
repo = repository.TestOpenBackend(t, be)
|
||||
repository.TestCheckRepo(t, repo)
|
||||
@@ -165,9 +165,9 @@ func TestPruneSmall(t *testing.T) {
|
||||
usedBlobs.Insert(blob)
|
||||
}
|
||||
return nil
|
||||
}, &progress.NoopPrinter{})
|
||||
}, progress.NewNoopPrinter())
|
||||
rtest.OK(t, err)
|
||||
rtest.OK(t, plan.Execute(context.TODO(), &progress.NoopPrinter{}))
|
||||
rtest.OK(t, plan.Execute(context.TODO(), progress.NewNoopPrinter()))
|
||||
|
||||
stats := plan.Stats()
|
||||
rtest.Equals(t, stats.Size.Used/blobSize, uint64(numBlobsCreated), fmt.Sprintf("total size of blobs should be %d but is %d",
|
||||
|
||||
@@ -162,7 +162,7 @@ func repack(t *testing.T, repo restic.Repository, be backend.Backend, packs rest
|
||||
func rebuildAndReloadIndex(t *testing.T, repo *repository.Repository) {
|
||||
rtest.OK(t, repository.RepairIndex(context.TODO(), repo, repository.RepairIndexOptions{
|
||||
ReadAllPacks: true,
|
||||
}, &progress.NoopPrinter{}))
|
||||
}, progress.NewNoopPrinter()))
|
||||
|
||||
rtest.OK(t, repo.LoadIndex(context.TODO(), nil))
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ func testRebuildIndex(t *testing.T, readAllPacks bool, damage func(t *testing.T,
|
||||
repo = repository.TestOpenBackend(t, be)
|
||||
rtest.OK(t, repository.RepairIndex(context.TODO(), repo, repository.RepairIndexOptions{
|
||||
ReadAllPacks: readAllPacks,
|
||||
}, &progress.NoopPrinter{}))
|
||||
}, progress.NewNoopPrinter()))
|
||||
|
||||
repository.TestCheckRepo(t, repo)
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ func testRepairBrokenPack(t *testing.T, version uint) {
|
||||
buf, err := backendtest.LoadAll(context.TODO(), be, h)
|
||||
rtest.OK(t, err)
|
||||
rtest.OK(t, be.Remove(context.TODO(), h))
|
||||
rtest.OK(t, repository.RepairIndex(context.TODO(), repo, repository.RepairIndexOptions{}, &progress.NoopPrinter{}))
|
||||
rtest.OK(t, repository.RepairIndex(context.TODO(), repo, repository.RepairIndexOptions{}, progress.NewNoopPrinter()))
|
||||
|
||||
rtest.OK(t, be.Save(context.TODO(), h, backend.NewByteReader(buf, be.Hasher())))
|
||||
|
||||
@@ -130,7 +130,7 @@ func testRepairBrokenPack(t *testing.T, version uint) {
|
||||
|
||||
toRepair, damagedBlobs := test.damage(t, random, repo, be, packsBefore)
|
||||
|
||||
rtest.OK(t, repository.RepairPacks(context.TODO(), repo, toRepair, &progress.NoopPrinter{}))
|
||||
rtest.OK(t, repository.RepairPacks(context.TODO(), repo, toRepair, progress.NewNoopPrinter()))
|
||||
// reload index
|
||||
rtest.OK(t, repo.LoadIndex(context.TODO(), nil))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user