Skip to content

Commit

Permalink
fix(errors): test failures (#10879)
Browse files Browse the repository at this point in the history
* fix(errors): test failures

* fix test
  • Loading branch information
aaronc authored Jan 4, 2022
1 parent bdee333 commit 401cf2f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion errors/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions errors/stacktrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions errors/stacktrace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 401cf2f

Please sign in to comment.