forked from TrueCloudLab/restic
Small refactorings and ceosmetic changes
This commit is contained in:
parent
a906b9febe
commit
c9f1f08019
7 changed files with 97 additions and 111 deletions
|
@ -21,8 +21,7 @@ var testFiles = []struct {
|
|||
{"bar/bla/blubb", []byte("This is just a test!\n")},
|
||||
}
|
||||
|
||||
// prepareDir creates a temporary directory and returns it.
|
||||
func prepareDir(t *testing.T) string {
|
||||
func createTempDir(t *testing.T) string {
|
||||
tempdir, err := ioutil.TempDir(*TestTempDir, "restic-test-")
|
||||
OK(t, err)
|
||||
|
||||
|
@ -48,7 +47,7 @@ func prepareDir(t *testing.T) string {
|
|||
}
|
||||
|
||||
func TestTree(t *testing.T) {
|
||||
dir := prepareDir(t)
|
||||
dir := createTempDir(t)
|
||||
defer func() {
|
||||
if *TestCleanup {
|
||||
OK(t, os.RemoveAll(dir))
|
||||
|
@ -89,7 +88,7 @@ func TestNodeComparison(t *testing.T) {
|
|||
n2 := *node
|
||||
Assert(t, node.Equals(n2), "nodes aren't equal")
|
||||
|
||||
n2.Size -= 1
|
||||
n2.Size--
|
||||
Assert(t, !node.Equals(n2), "nodes are equal")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue