mirror of
https://github.com/restic/restic.git
synced 2025-10-09 15:30:24 +00:00
panic if hash returns an error
Add a sanity check that the interface contract is honoured.
This commit is contained in:
@@ -547,7 +547,10 @@ func (s *Suite) TestSave(t *testing.T) {
|
||||
if b.Hasher() != nil {
|
||||
beHasher := b.Hasher()
|
||||
// must never fail according to interface
|
||||
_, _ = beHasher.Write(data)
|
||||
_, err := beHasher.Write(data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
beHash = beHasher.Sum(nil)
|
||||
}
|
||||
err = b.Save(context.TODO(), h, errorCloser{
|
||||
|
Reference in New Issue
Block a user