@@ -3130,31 +3130,34 @@ func TestErrorAs(t *testing.T) {
31303130 {
31313131 err : io .EOF ,
31323132 result : false ,
3133- resultErrMsg : "Should be in error chain:\n " +
3133+ resultErrMsg : "" +
3134+ "Should be in error chain:\n " +
31343135 "expected: **assert.customError\n " +
31353136 "in chain: \" EOF\" (*errors.errorString)\n " ,
31363137 },
31373138 {
31383139 err : nil ,
31393140 result : false ,
3140- resultErrMsg : "Should be in error chain:\n " +
3141+ resultErrMsg : "" +
3142+ "Should be in error chain:\n " +
31413143 "expected: **assert.customError\n " +
31423144 "in chain: \n " ,
31433145 },
31443146 {
31453147 err : fmt .Errorf ("abc: %w" , errors .New ("def" )),
31463148 result : false ,
3147- resultErrMsg : "Should be in error chain:\n " +
3149+ resultErrMsg : "" +
3150+ "Should be in error chain:\n " +
31483151 "expected: **assert.customError\n " +
31493152 "in chain: \" abc: def\" (*fmt.wrapError)\n " +
31503153 "\t \" def\" (*errors.errorString)\n " ,
31513154 },
31523155 }
31533156 for _ , tt := range tests {
31543157 tt := tt
3155- mockT := new (captureTestingT )
31563158 var target * customError
31573159 t .Run (fmt .Sprintf ("ErrorAs(%#v,%#v)" , tt .err , target ), func (t * testing.T ) {
3160+ mockT := new (captureTestingT )
31583161 res := ErrorAs (mockT , tt .err , & target )
31593162 mockT .checkResultAndErrMsg (t , tt .result , res , tt .resultErrMsg )
31603163 })
0 commit comments