Update cipher_test.go to correctly process wrapped errors via require.ErrorIs
This commit is contained in:
parent
f90fb44309
commit
1d3df7c1c5
1 changed files with 2 additions and 2 deletions
|
@ -91,7 +91,7 @@ func TestReader(t *testing.T) {
|
||||||
r := NewReader(testCase.r, testCase.prng)
|
r := NewReader(testCase.r, testCase.prng)
|
||||||
|
|
||||||
buf, err := ioutil.ReadAll(r)
|
buf, err := ioutil.ReadAll(r)
|
||||||
require.Equal(t, testCase.err, err)
|
require.ErrorIs(t, err, testCase.err)
|
||||||
require.Equal(t, testCase.result, buf)
|
require.Equal(t, testCase.result, buf)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ func TestWriterError(t *testing.T) {
|
||||||
n, err := w.Write(plaintext)
|
n, err := w.Write(plaintext)
|
||||||
|
|
||||||
require.Equalf(t, plaintextBackup, plaintext, "Write must not modify the slice data, even temporarily.")
|
require.Equalf(t, plaintextBackup, plaintext, "Write must not modify the slice data, even temporarily.")
|
||||||
require.Equal(t, err, iotest.ErrTimeout)
|
require.ErrorIs(t, err, iotest.ErrTimeout)
|
||||||
require.Equal(t, 512, n)
|
require.Equal(t, 512, n)
|
||||||
require.Equal(t, out.buf.Bytes(), ciphertext[:512])
|
require.Equal(t, out.buf.Bytes(), ciphertext[:512])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue