1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-23 16:26:11 +00:00

checker: Use TestRepository

This commit is contained in:
Alexander Neumann 2017-01-24 09:23:13 +01:00
parent 31055d88a5
commit 0e445ec0f5

View file

@ -9,7 +9,6 @@ import (
"restic"
"restic/archiver"
"restic/backend/mem"
"restic/checker"
"restic/repository"
"restic/test"
@ -249,19 +248,15 @@ func induceError(data []byte) {
}
func TestCheckerModifiedData(t *testing.T) {
be := mem.New()
repository.TestUseLowSecurityKDFParameters(t)
repo := repository.New(be)
test.OK(t, repo.Init(test.TestPassword))
repo, cleanup := repository.TestRepository(t)
defer cleanup()
arch := archiver.New(repo)
_, id, err := arch.Snapshot(nil, []string{"."}, nil, nil)
test.OK(t, err)
t.Logf("archived as %v", id.Str())
beError := &errorBackend{Backend: be}
beError := &errorBackend{Backend: repo.Backend()}
checkRepo := repository.New(beError)
test.OK(t, checkRepo.SearchKey(test.TestPassword, 5))