1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-23 08:16:36 +00:00

backend: Improve TestList

This commit is contained in:
Alexander Neumann 2017-09-18 13:18:42 +02:00
parent 835ba16c27
commit 4c6b626db6

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)
}
}