test: Use testing.T.Cleanup to remove tempdirs

This commit is contained in:
greatroar 2022-12-09 13:42:33 +01:00
parent eae7366563
commit f90bf84ba7
31 changed files with 79 additions and 176 deletions

View file

@ -439,9 +439,7 @@ func TestTree(t *testing.T) {
t.Skip("skip test on unix")
}
tempdir, cleanup := restictest.TempDir(t)
defer cleanup()
tempdir := restictest.TempDir(t)
TestCreateFiles(t, tempdir, test.src)
back := restictest.Chdir(t, tempdir)