mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 06:46:34 +00:00
backend/tests: Drain reader before returning error
This commit is contained in:
parent
fe99340e40
commit
4dc0f24b38
@ -147,6 +147,10 @@ func (s *Suite) TestLoad(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
err = b.Load(context.TODO(), handle, 0, 0, func(rd io.Reader) error {
|
err = b.Load(context.TODO(), handle, 0, 0, func(rd io.Reader) error {
|
||||||
|
_, err := io.Copy(ioutil.Discard, rd)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
return errors.Errorf("deliberate error")
|
return errors.Errorf("deliberate error")
|
||||||
})
|
})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user