2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-23 03:18:55 +00:00

Add benchmark for Node.fillExtra

This commit is contained in:
Alexander Neumann 2015-05-01 23:52:36 +02:00
parent d753a5ffa3
commit d8e1482abe

27
node_test.go Normal file
View File

@ -0,0 +1,27 @@
package restic
import (
"io/ioutil"
"testing"
)
func BenchmarkNodeFillUser(t *testing.B) {
tempfile, err := ioutil.TempFile("", "restic-test-temp-")
if err != nil {
t.Fatal(err)
}
fi, err := tempfile.Stat()
if err != nil {
t.Fatal(err)
}
node := &Node{}
path := tempfile.Name()
t.ResetTimer()
for i := 0; i < t.N; i++ {
node.fillExtra(path, fi)
}
}