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:
@@ -204,7 +204,7 @@ func TestPrepareCheckCache(t *testing.T) {
|
||||
rtest.OK(t, err)
|
||||
}
|
||||
gopts := global.Options{CacheDir: tmpDirBase}
|
||||
cleanup := prepareCheckCache(testCase.opts, &gopts, &progress.NoopPrinter{})
|
||||
cleanup := prepareCheckCache(testCase.opts, &gopts, progress.NewNoopPrinter())
|
||||
files, err := os.ReadDir(tmpDirBase)
|
||||
rtest.OK(t, err)
|
||||
|
||||
@@ -234,7 +234,7 @@ func TestPrepareCheckCache(t *testing.T) {
|
||||
|
||||
func TestPrepareDefaultCheckCache(t *testing.T) {
|
||||
gopts := global.Options{CacheDir: ""}
|
||||
cleanup := prepareCheckCache(CheckOptions{}, &gopts, &progress.NoopPrinter{})
|
||||
cleanup := prepareCheckCache(CheckOptions{}, &gopts, progress.NewNoopPrinter())
|
||||
_, err := os.ReadDir(gopts.CacheDir)
|
||||
rtest.OK(t, err)
|
||||
|
||||
|
||||
@@ -57,14 +57,14 @@ func TestInitCopyChunkerParams(t *testing.T) {
|
||||
|
||||
var repo *repository.Repository
|
||||
err = withTermStatus(t, env.gopts, func(ctx context.Context, gopts global.Options) error {
|
||||
repo, err = global.OpenRepository(ctx, gopts, &progress.NoopPrinter{})
|
||||
repo, err = global.OpenRepository(ctx, gopts, progress.NewNoopPrinter())
|
||||
return err
|
||||
})
|
||||
rtest.OK(t, err)
|
||||
|
||||
var otherRepo *repository.Repository
|
||||
err = withTermStatus(t, env2.gopts, func(ctx context.Context, gopts global.Options) error {
|
||||
otherRepo, err = global.OpenRepository(ctx, gopts, &progress.NoopPrinter{})
|
||||
otherRepo, err = global.OpenRepository(ctx, gopts, progress.NewNoopPrinter())
|
||||
return err
|
||||
})
|
||||
rtest.OK(t, err)
|
||||
|
||||
@@ -63,7 +63,7 @@ func testRunKeyAddNewKeyUserHost(t testing.TB, gopts global.Options) {
|
||||
rtest.OK(t, err)
|
||||
|
||||
_ = withTermStatus(t, gopts, func(ctx context.Context, gopts global.Options) error {
|
||||
repo, err := global.OpenRepository(ctx, gopts, &progress.NoopPrinter{})
|
||||
repo, err := global.OpenRepository(ctx, gopts, progress.NewNoopPrinter())
|
||||
rtest.OK(t, err)
|
||||
key, err := repository.SearchKey(ctx, repo, testKeyNewPassword, 2, "")
|
||||
rtest.OK(t, err)
|
||||
@@ -105,7 +105,7 @@ func testRunKeyPasswdUserHost(t testing.TB, newPassword string, gopts global.Opt
|
||||
|
||||
gopts.Password = testKeyNewPassword
|
||||
_ = withTermStatus(t, gopts, func(ctx context.Context, gopts global.Options) error {
|
||||
repo, err := global.OpenRepository(ctx, gopts, &progress.NoopPrinter{})
|
||||
repo, err := global.OpenRepository(ctx, gopts, progress.NewNoopPrinter())
|
||||
rtest.OK(t, err)
|
||||
key, err := repository.SearchKey(ctx, repo, testKeyNewPassword, 1, "")
|
||||
rtest.OK(t, err)
|
||||
|
||||
Reference in New Issue
Block a user