mirror of
https://github.com/restic/restic.git
synced 2024-12-23 16:26:11 +00:00
index: Check structure after saving a new index
This commit is contained in:
parent
7719cf88d9
commit
ca3c566a99
1 changed files with 15 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue