[#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>
remotes/fyrchik/update-contracts
Leonard Lyubich 2022-06-27 21:30:06 +03:00 committed by fyrchik
parent 1e1139f305
commit d2cd9ebfbd
1 changed files with 3 additions and 1 deletions

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