From b8af7f63a0c55117371ded5beb6bd68d57997efc Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 14 Oct 2017 15:53:32 +0200 Subject: [PATCH] backend test: Always remove files for TestList --- internal/backend/test/tests.go | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/internal/backend/test/tests.go b/internal/backend/test/tests.go index e32e2c421..2b4b31b8a 100644 --- a/internal/backend/test/tests.go +++ b/internal/backend/test/tests.go @@ -675,24 +675,21 @@ func (s *Suite) TestBackend(t *testing.T) { t.Fatalf("lists aren't equal, want:\n %v\n got:\n%v\n", IDs, list) } - // remove content if requested - if test.TestCleanupTempDirs { - var handles []restic.Handle - for _, ts := range testStrings { - id, err := restic.ParseID(ts.id) - test.OK(t, err) + var handles []restic.Handle + for _, ts := range testStrings { + id, err := restic.ParseID(ts.id) + test.OK(t, err) - h := restic.Handle{Type: tpe, Name: id.String()} + h := restic.Handle{Type: tpe, Name: id.String()} - found, err := b.Test(context.TODO(), h) - test.OK(t, err) - test.Assert(t, found, fmt.Sprintf("id %q not found", id)) + found, err := b.Test(context.TODO(), h) + test.OK(t, err) + test.Assert(t, found, fmt.Sprintf("id %q not found", id)) - handles = append(handles, h) - } - - test.OK(t, s.delayedRemove(t, b, handles...)) + handles = append(handles, h) } + + test.OK(t, s.delayedRemove(t, b, handles...)) } }