mirror of
https://github.com/restic/restic.git
synced 2025-08-22 19:58:09 +00:00
restore: add dry-run support
This commit is contained in:
@@ -83,6 +83,14 @@ func (p *printerMock) Finish(s restoreui.State, _ time.Duration) {
|
||||
}
|
||||
|
||||
func TestRestorerProgressBar(t *testing.T) {
|
||||
testRestorerProgressBar(t, false)
|
||||
}
|
||||
|
||||
func TestRestorerProgressBarDryRun(t *testing.T) {
|
||||
testRestorerProgressBar(t, true)
|
||||
}
|
||||
|
||||
func testRestorerProgressBar(t *testing.T, dryRun bool) {
|
||||
repo := repository.TestRepository(t)
|
||||
|
||||
sn, _ := saveSnapshot(t, repo, Snapshot{
|
||||
@@ -99,7 +107,7 @@ func TestRestorerProgressBar(t *testing.T) {
|
||||
|
||||
mock := &printerMock{}
|
||||
progress := restoreui.NewProgress(mock, 0)
|
||||
res := NewRestorer(repo, sn, Options{Progress: progress})
|
||||
res := NewRestorer(repo, sn, Options{Progress: progress, DryRun: dryRun})
|
||||
res.SelectFilter = func(item string, dstpath string, node *restic.Node) (selectedForRestore bool, childMayBeSelected bool) {
|
||||
return true, true
|
||||
}
|
||||
|
Reference in New Issue
Block a user