backend: Improve TestList

This commit is contained in:
Alexander Neumann 2017-09-18 13:18:42 +02:00
parent 835ba16c27
commit 4c6b626db6
1 changed files with 8 additions and 7 deletions

View File

@ -267,8 +267,7 @@ func (s *Suite) TestList(t *testing.T) {
var tests = []struct {
maxItems int
}{
{3}, {8}, {11}, {13}, {23},
{numTestFiles}, {numTestFiles + 7}, {numTestFiles + 10}, {numTestFiles + 1123},
{11}, {23}, {numTestFiles}, {numTestFiles + 10}, {numTestFiles + 1123},
}
for _, test := range tests {
@ -302,12 +301,14 @@ func (s *Suite) TestList(t *testing.T) {
}
t.Logf("remove %d files", numTestFiles)
handles := make([]restic.Handle, 0, len(list1))
for id := range list1 {
h := restic.Handle{Type: restic.DataFile, Name: id.String()}
err := s.delayedRemove(t, b, h)
if err != nil {
t.Fatal(err)
}
handles = append(handles, restic.Handle{Type: restic.DataFile, Name: id.String()})
}
err := s.delayedRemove(t, b, handles...)
if err != nil {
t.Fatal(err)
}
}