mirror of
https://github.com/restic/restic.git
synced 2026-06-19 15:14:17 +00:00
ui/progress: unexport NoopPrinter and add New* function
This commit is contained in:
@@ -37,7 +37,7 @@ type mockPrinter struct {
|
||||
trace printerTrace
|
||||
items itemTrace
|
||||
errors errorTrace
|
||||
progress.NoopPrinter
|
||||
progress.Printer
|
||||
}
|
||||
|
||||
const mockFinishDuration = 42 * time.Second
|
||||
@@ -57,7 +57,7 @@ func (p *mockPrinter) Finish(progress State, _ time.Duration) {
|
||||
}
|
||||
|
||||
func testProgress(fn func(progress *Progress) bool) (printerTrace, itemTrace, errorTrace) {
|
||||
printer := &mockPrinter{}
|
||||
printer := &mockPrinter{Printer: progress.NewNoopPrinter()}
|
||||
progress := NewProgress(printer, 0)
|
||||
final := fn(progress)
|
||||
progress.update(0, final)
|
||||
|
||||
Reference in New Issue
Block a user