mirror of
https://github.com/restic/restic.git
synced 2025-12-03 21:21:47 +00:00
repository: Remove empty cleanup functions in tests
TestRepository and its variants always returned no-op cleanup functions. If they ever do need to do cleanup, using testing.T.Cleanup is easier than passing these functions around.
This commit is contained in:
@@ -328,14 +328,13 @@ var (
|
||||
depth = 3
|
||||
)
|
||||
|
||||
func createFilledRepo(t testing.TB, snapshots int, dup float32, version uint) (restic.Repository, func()) {
|
||||
repo, cleanup := repository.TestRepositoryWithVersion(t, version)
|
||||
func createFilledRepo(t testing.TB, snapshots int, dup float32, version uint) restic.Repository {
|
||||
repo := repository.TestRepositoryWithVersion(t, version)
|
||||
|
||||
for i := 0; i < 3; i++ {
|
||||
restic.TestCreateSnapshot(t, repo, snapshotTime.Add(time.Duration(i)*time.Second), depth, dup)
|
||||
}
|
||||
|
||||
return repo, cleanup
|
||||
return repo
|
||||
}
|
||||
|
||||
func TestIndexSave(t *testing.T) {
|
||||
@@ -343,8 +342,7 @@ func TestIndexSave(t *testing.T) {
|
||||
}
|
||||
|
||||
func testIndexSave(t *testing.T, version uint) {
|
||||
repo, cleanup := createFilledRepo(t, 3, 0, version)
|
||||
defer cleanup()
|
||||
repo := createFilledRepo(t, 3, 0, version)
|
||||
|
||||
err := repo.LoadIndex(context.TODO())
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user