mirror of
https://github.com/restic/restic.git
synced 2026-08-03 04:32:17 +00:00
ui/progress: unexport NoopPrinter and add New* function
This commit is contained in:
@@ -989,7 +989,7 @@ func TestRestorerSparseOverwrite(t *testing.T) {
|
||||
|
||||
type printerMock struct {
|
||||
s restoreui.State
|
||||
progress.NoopPrinter
|
||||
progress.Printer
|
||||
}
|
||||
|
||||
func (p *printerMock) Update(_ restoreui.State, _ time.Duration) {
|
||||
@@ -1102,7 +1102,7 @@ func TestRestorerOverwriteBehavior(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run("", func(t *testing.T) {
|
||||
mock := &printerMock{}
|
||||
mock := &printerMock{Printer: progress.NewNoopPrinter()}
|
||||
progress := restoreui.NewProgress(mock, 0)
|
||||
tempdir := saveSnapshotsAndOverwrite(t, baseSnapshot, overwriteSnapshot, Options{}, Options{Overwrite: test.Overwrite, Progress: progress})
|
||||
|
||||
@@ -1154,7 +1154,7 @@ func TestRestorerOverwritePartial(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
mock := &printerMock{}
|
||||
mock := &printerMock{Printer: progress.NewNoopPrinter()}
|
||||
progress := restoreui.NewProgress(mock, 0)
|
||||
saveSnapshotsAndOverwrite(t, baseSnapshot, overwriteSnapshot, Options{}, Options{Overwrite: OverwriteAlways, Progress: progress})
|
||||
progress.Finish()
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
|
||||
"github.com/restic/restic/internal/repository"
|
||||
rtest "github.com/restic/restic/internal/test"
|
||||
"github.com/restic/restic/internal/ui/progress"
|
||||
restoreui "github.com/restic/restic/internal/ui/restore"
|
||||
)
|
||||
|
||||
@@ -87,7 +88,7 @@ func testRestorerProgressBar(t *testing.T, dryRun bool) {
|
||||
},
|
||||
}, noopGetGenericAttributes)
|
||||
|
||||
mock := &printerMock{}
|
||||
mock := &printerMock{Printer: progress.NewNoopPrinter()}
|
||||
progress := restoreui.NewProgress(mock, 0)
|
||||
res := NewRestorer(repo, sn, Options{Progress: progress, DryRun: dryRun})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user