Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
craig65535 committed Jan 26, 2024
1 parent ed3d1bc commit 972befb
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 @@ -3143,31 +3143,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 972befb

Please sign in to comment.