testify
testify copied to clipboard
Fixed `assert.ErrorAs()` error log text
Summary
Improve message of assert.ErrorAs()
Changes
- Replace non-informative message like
expected: %!q(**pgconn.PgError=0xc000114050)
to the human readable one. - Replaced simple output of
"%s", err.Error()
to"%T(%s)"
for better readability.
Motivation
- First the
%!q(**pgconn.PgError=0xc000114050)
text is the broken format string - Second — even fixed, resulting
err.Error()
provides not enough information to see what exactly type of error is expected inerrors.As
and what is provided.
Related issues
Closes #1115