mirror of
https://github.com/restic/restic.git
synced 2026-09-22 03:58:31 +00:00
restic: move Printer interface from internal/ui/progress
Move Printer and NewNoopPrinter to internal/restic so repository does not have to import the ui packages.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package restore
|
||||
|
||||
import (
|
||||
"github.com/restic/restic/internal/restic"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -37,7 +38,7 @@ type mockPrinter struct {
|
||||
trace printerTrace
|
||||
items itemTrace
|
||||
errors errorTrace
|
||||
progress.Printer
|
||||
restic.Printer
|
||||
}
|
||||
|
||||
const mockFinishDuration = 42 * time.Second
|
||||
@@ -57,7 +58,7 @@ func (p *mockPrinter) Finish(progress State, _ time.Duration) {
|
||||
}
|
||||
|
||||
func testProgress(fn func(progress *Progress) bool) (printerTrace, itemTrace, errorTrace) {
|
||||
printer := &mockPrinter{Printer: progress.NewNoopPrinter()}
|
||||
printer := &mockPrinter{Printer: restic.NewNoopPrinter()}
|
||||
progress := newProgress(printer, 0)
|
||||
final := fn(progress)
|
||||
progress.update(0, final)
|
||||
|
||||
Reference in New Issue
Block a user