restic: Cleanup and simplify TestCreateSnapshot

This commit is contained in:
Michael Eischer
2023-07-16 15:55:05 +02:00
parent 321cc35cde
commit 090f9d6237
7 changed files with 37 additions and 74 deletions

View File

@@ -340,11 +340,11 @@ var (
depth = 3
)
func createFilledRepo(t testing.TB, snapshots int, dup float32, version uint) restic.Repository {
func createFilledRepo(t testing.TB, snapshots int, version uint) restic.Repository {
repo := repository.TestRepositoryWithVersion(t, version)
for i := 0; i < snapshots; i++ {
restic.TestCreateSnapshot(t, repo, snapshotTime.Add(time.Duration(i)*time.Second), depth, dup)
restic.TestCreateSnapshot(t, repo, snapshotTime.Add(time.Duration(i)*time.Second), depth)
}
return repo
}
@@ -354,7 +354,7 @@ func TestIndexSave(t *testing.T) {
}
func testIndexSave(t *testing.T, version uint) {
repo := createFilledRepo(t, 3, 0, version)
repo := createFilledRepo(t, 3, version)
err := repo.LoadIndex(context.TODO())
if err != nil {