Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
craig65535 committed Nov 9, 2023
1 parent f56991b commit 8d13f2e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions assert/assertions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3130,31 +3130,34 @@ func TestErrorAs(t *testing.T) {
{
err: io.EOF,
result: false,
resultErrMsg: "Should be in error chain:\n" +
resultErrMsg: "" +
"Should be in error chain:\n" +
"expected: **assert.customError\n" +
"in chain: \"EOF\" (*errors.errorString)\n",
},
{
err: nil,
result: false,
resultErrMsg: "Should be in error chain:\n" +
resultErrMsg: "" +
"Should be in error chain:\n" +
"expected: **assert.customError\n" +
"in chain: \n",
},
{
err: fmt.Errorf("abc: %w", errors.New("def")),
result: false,
resultErrMsg: "Should be in error chain:\n" +
resultErrMsg: "" +
"Should be in error chain:\n" +
"expected: **assert.customError\n" +
"in chain: \"abc: def\" (*fmt.wrapError)\n" +
"\t\"def\" (*errors.errorString)\n",
},
}
for _, tt := range tests {
tt := tt
mockT := new(captureTestingT)
var target *customError
t.Run(fmt.Sprintf("ErrorAs(%#v,%#v)", tt.err, target), func(t *testing.T) {
mockT := new(captureTestingT)
res := ErrorAs(mockT, tt.err, &target)
mockT.checkResultAndErrMsg(t, tt.result, res, tt.resultErrMsg)
})
Expand Down

0 comments on commit 8d13f2e

Please sign in to comment.