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

index: Check structure after saving a new index

This commit is contained in:
Alexander Neumann 2018-01-25 21:59:11 +01:00
parent 7719cf88d9
commit ca3c566a99

View file

@ -302,6 +302,21 @@ func TestIndexSave(t *testing.T) {
for _, err := range errs {
t.Errorf("checker found error: %v", err)
}
ctx, cancel := context.WithCancel(context.TODO())
errCh := make(chan error)
go checker.Structure(ctx, errCh)
i := 0
for err := range errCh {
t.Errorf("checker returned error: %v", err)
i++
if i == 10 {
t.Errorf("more than 10 errors returned, skipping the rest")
cancel()
break
}
}
}
func TestIndexAddRemovePack(t *testing.T) {