From 1d3df7c1c5265ea664d7c5d90e71b6e3a218f5f5 Mon Sep 17 00:00:00 2001 From: Covariance Date: Thu, 3 Mar 2022 12:37:25 +0000 Subject: [PATCH] Update cipher_test.go to correctly process wrapped errors via `require.ErrorIs` --- otp/cipher_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/otp/cipher_test.go b/otp/cipher_test.go index f84a1a7..80901b9 100644 --- a/otp/cipher_test.go +++ b/otp/cipher_test.go @@ -91,7 +91,7 @@ func TestReader(t *testing.T) { r := NewReader(testCase.r, testCase.prng) buf, err := ioutil.ReadAll(r) - require.Equal(t, testCase.err, err) + require.ErrorIs(t, err, testCase.err) require.Equal(t, testCase.result, buf) }) } @@ -139,7 +139,7 @@ func TestWriterError(t *testing.T) { n, err := w.Write(plaintext) 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, out.buf.Bytes(), ciphertext[:512]) }