mirror of https://github.com/stretchr/testify.git
dereference target
parent
1c717c00c1
commit
c60c3bd7fb
|
@ -2146,8 +2146,8 @@ func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{
|
|||
chain := buildErrorChainString(err, true)
|
||||
|
||||
return Fail(t, fmt.Sprintf("Should be in error chain:\n"+
|
||||
"expected: %T\n"+
|
||||
"in chain: %s", target, chain,
|
||||
"expected: %s\n"+
|
||||
"in chain: %s", reflect.ValueOf(target).Elem().Type(), chain,
|
||||
), msgAndArgs...)
|
||||
}
|
||||
|
||||
|
@ -2164,8 +2164,8 @@ func NotErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interfa
|
|||
chain := buildErrorChainString(err, true)
|
||||
|
||||
return Fail(t, fmt.Sprintf("Target error should not be in err chain:\n"+
|
||||
"found: %T\n"+
|
||||
"in chain: %s", target, chain,
|
||||
"found: %s\n"+
|
||||
"in chain: %s", reflect.ValueOf(target).Elem().Type(), chain,
|
||||
), msgAndArgs...)
|
||||
}
|
||||
|
||||
|
|
|
@ -3367,7 +3367,7 @@ func TestErrorAs(t *testing.T) {
|
|||
result: false,
|
||||
resultErrMsg: "" +
|
||||
"Should be in error chain:\n" +
|
||||
"expected: **assert.customError\n" +
|
||||
"expected: *assert.customError\n" +
|
||||
"in chain: \"EOF\" (*errors.errorString)\n",
|
||||
},
|
||||
{
|
||||
|
@ -3375,7 +3375,7 @@ func TestErrorAs(t *testing.T) {
|
|||
result: false,
|
||||
resultErrMsg: "" +
|
||||
"Should be in error chain:\n" +
|
||||
"expected: **assert.customError\n" +
|
||||
"expected: *assert.customError\n" +
|
||||
"in chain: \n",
|
||||
},
|
||||
{
|
||||
|
@ -3383,7 +3383,7 @@ func TestErrorAs(t *testing.T) {
|
|||
result: false,
|
||||
resultErrMsg: "" +
|
||||
"Should be in error chain:\n" +
|
||||
"expected: **assert.customError\n" +
|
||||
"expected: *assert.customError\n" +
|
||||
"in chain: \"abc: def\" (*fmt.wrapError)\n" +
|
||||
"\t\"def\" (*errors.errorString)\n",
|
||||
},
|
||||
|
@ -3410,7 +3410,7 @@ func TestNotErrorAs(t *testing.T) {
|
|||
result: false,
|
||||
resultErrMsg: "" +
|
||||
"Target error should not be in err chain:\n" +
|
||||
"found: **assert.customError\n" +
|
||||
"found: *assert.customError\n" +
|
||||
"in chain: \"wrap: fail\" (*fmt.wrapError)\n" +
|
||||
"\t\"fail\" (*assert.customError)\n",
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue