From d2cd9ebfbdcb50a86fe2477ee350acb2a5e1174a Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 27 Jun 2022 21:30:06 +0300 Subject: [PATCH] [#278] client: Increase depth of error wrapping in `IsErr*` tests Wrap test error twice just to be sure error unwrapping goes deep. Signed-off-by: Leonard Lyubich --- client/errors_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/errors_test.go b/client/errors_test.go index 8f985d05..2f85df0c 100644 --- a/client/errors_test.go +++ b/client/errors_test.go @@ -53,7 +53,9 @@ func TestErrors(t *testing.T) { for i := range tc.errs { require.True(t, tc.check(tc.errs[i]), tc.errs[i]) - require.True(t, tc.check(fmt.Errorf("some context: %w", tc.errs[i])), tc.errs[i]) + require.True(t, tc.check(fmt.Errorf("top-level context: :%w", + fmt.Errorf("inner context: %w", tc.errs[i])), + ), tc.errs[i]) } } }