2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-23 13:17:42 +00:00

use OrderedListOnceBackend where possible

This commit is contained in:
Michael Eischer 2024-08-29 16:35:48 +02:00
parent d19f706d50
commit dd90e1926b
2 changed files with 4 additions and 5 deletions

View File

@ -146,10 +146,9 @@ func TestPruneWithDamagedRepository(t *testing.T) {
env.gopts.backendTestHook = oldHook env.gopts.backendTestHook = oldHook
}() }()
// prune should fail // prune should fail
rtest.Assert(t, withTermStatus(env.gopts, func(ctx context.Context, term *termstatus.Terminal) error { rtest.Equals(t, repository.ErrPacksMissing, withTermStatus(env.gopts, func(ctx context.Context, term *termstatus.Terminal) error {
return runPrune(context.TODO(), pruneDefaultOptions, env.gopts, term) return runPrune(context.TODO(), pruneDefaultOptions, env.gopts, term)
}) == repository.ErrPacksMissing, }), "prune should have reported index not complete error")
"prune should have reported index not complete error")
} }
// Test repos for edge cases // Test repos for edge cases

View File

@ -80,7 +80,7 @@ func TestListOnce(t *testing.T) {
defer cleanup() defer cleanup()
env.gopts.backendTestHook = func(r backend.Backend) (backend.Backend, error) { env.gopts.backendTestHook = func(r backend.Backend) (backend.Backend, error) {
return newListOnceBackend(r), nil return newOrderedListOnceBackend(r), nil
} }
pruneOpts := PruneOptions{MaxUnused: "0"} pruneOpts := PruneOptions{MaxUnused: "0"}
checkOpts := CheckOptions{ReadData: true, CheckUnused: true} checkOpts := CheckOptions{ReadData: true, CheckUnused: true}
@ -148,7 +148,7 @@ func TestFindListOnce(t *testing.T) {
defer cleanup() defer cleanup()
env.gopts.backendTestHook = func(r backend.Backend) (backend.Backend, error) { env.gopts.backendTestHook = func(r backend.Backend) (backend.Backend, error) {
return newListOnceBackend(r), nil return newOrderedListOnceBackend(r), nil
} }
testSetupBackupData(t, env) testSetupBackupData(t, env)