fix(errors): test failures (#10879)

* fix(errors): test failures

* fix test
This commit is contained in:
Aaron Craelius 2022-01-04 18:19:08 -05:00 committed by GitHub
parent bdee3337d3
commit 401cf2f394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -143,7 +143,7 @@ func (s *abciTestSuite) TestABCIInfoStacktrace() {
},
}
const thisTestSrc = "github.com/cosmos/cosmos-sdk/types/errors.(*abciTestSuite).TestABCIInfoStacktrace"
const thisTestSrc = "github.com/cosmos/cosmos-sdk/errors.(*abciTestSuite).TestABCIInfoStacktrace"
for testName, tc := range cases {
_, _, log := ABCIInfo(tc.err, tc.debug)

View File

@ -48,9 +48,9 @@ func trimInternal(st errors.StackTrace) errors.StackTrace {
// manual error creation, or runtime for caught panics
for matchesFunc(st[0],
// where we create errors
"github.com/cosmos/cosmos-sdk/types/errors.Wrap",
"github.com/cosmos/cosmos-sdk/types/errors.Wrapf",
"github.com/cosmos/cosmos-sdk/types/errors.WithType",
"github.com/cosmos/cosmos-sdk/errors.Wrap",
"github.com/cosmos/cosmos-sdk/errors.Wrapf",
"github.com/cosmos/cosmos-sdk/errors.WithType",
// runtime are added on panics
"runtime.",
// _test is defined in coverage tests, causing failure

View File

@ -32,11 +32,11 @@ func (s *errorsTestSuite) TestStackTrace() {
// Wrapping code is unwanted in the errors stack trace.
unwantedSrc := []string{
"github.com/cosmos/cosmos-sdk/types/errors.Wrap\n",
"github.com/cosmos/cosmos-sdk/types/errors.Wrapf\n",
"github.com/cosmos/cosmos-sdk/errors.Wrap\n",
"github.com/cosmos/cosmos-sdk/errors.Wrapf\n",
"runtime.goexit\n",
}
const thisTestSrc = "types/errors/stacktrace_test.go"
const thisTestSrc = "errors/stacktrace_test.go"
for _, tc := range cases {
s.Require().True(reflect.DeepEqual(tc.err.Error(), tc.wantError))