1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-24 08:44:52 +00:00

Remove tempfiles after test

This commit is contained in:
Alexander Neumann 2015-10-31 14:53:03 +01:00
parent fccde030d5
commit ed9470b19d

View file

@ -15,7 +15,6 @@ import (
func BenchmarkNodeFillUser(t *testing.B) {
tempfile, err := ioutil.TempFile("", "restic-test-temp-")
defer tempfile.Close()
if err != nil {
t.Fatal(err)
}
@ -32,11 +31,13 @@ func BenchmarkNodeFillUser(t *testing.B) {
for i := 0; i < t.N; i++ {
restic.NodeFromFileInfo(path, fi)
}
OK(t, tempfile.Close())
RemoveAll(t, tempfile.Name())
}
func BenchmarkNodeFromFileInfo(t *testing.B) {
tempfile, err := ioutil.TempFile("", "restic-test-temp-")
defer tempfile.Close()
if err != nil {
t.Fatal(err)
}
@ -56,6 +57,9 @@ func BenchmarkNodeFromFileInfo(t *testing.B) {
t.Fatal(err)
}
}
OK(t, tempfile.Close())
RemoveAll(t, tempfile.Name())
}
func parseTime(s string) time.Time {