[#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 <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-06-27 21:30:06 +03:00 committed by fyrchik
parent 1e1139f305
commit d2cd9ebfbd

View file

@ -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])
}
}
}