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)
|
chain := buildErrorChainString(err, true)
|
||||||
|
|
||||||
return Fail(t, fmt.Sprintf("Should be in error chain:\n"+
|
return Fail(t, fmt.Sprintf("Should be in error chain:\n"+
|
||||||
"expected: %T\n"+
|
"expected: %s\n"+
|
||||||
"in chain: %s", target, chain,
|
"in chain: %s", reflect.ValueOf(target).Elem().Type(), chain,
|
||||||
), msgAndArgs...)
|
), msgAndArgs...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2164,8 +2164,8 @@ func NotErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interfa
|
||||||
chain := buildErrorChainString(err, true)
|
chain := buildErrorChainString(err, true)
|
||||||
|
|
||||||
return Fail(t, fmt.Sprintf("Target error should not be in err chain:\n"+
|
return Fail(t, fmt.Sprintf("Target error should not be in err chain:\n"+
|
||||||
"found: %T\n"+
|
"found: %s\n"+
|
||||||
"in chain: %s", target, chain,
|
"in chain: %s", reflect.ValueOf(target).Elem().Type(), chain,
|
||||||
), msgAndArgs...)
|
), msgAndArgs...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3367,7 +3367,7 @@ func TestErrorAs(t *testing.T) {
|
||||||
result: false,
|
result: false,
|
||||||
resultErrMsg: "" +
|
resultErrMsg: "" +
|
||||||
"Should be in error chain:\n" +
|
"Should be in error chain:\n" +
|
||||||
"expected: **assert.customError\n" +
|
"expected: *assert.customError\n" +
|
||||||
"in chain: \"EOF\" (*errors.errorString)\n",
|
"in chain: \"EOF\" (*errors.errorString)\n",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -3375,7 +3375,7 @@ func TestErrorAs(t *testing.T) {
|
||||||
result: false,
|
result: false,
|
||||||
resultErrMsg: "" +
|
resultErrMsg: "" +
|
||||||
"Should be in error chain:\n" +
|
"Should be in error chain:\n" +
|
||||||
"expected: **assert.customError\n" +
|
"expected: *assert.customError\n" +
|
||||||
"in chain: \n",
|
"in chain: \n",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -3383,7 +3383,7 @@ func TestErrorAs(t *testing.T) {
|
||||||
result: false,
|
result: false,
|
||||||
resultErrMsg: "" +
|
resultErrMsg: "" +
|
||||||
"Should be in error chain:\n" +
|
"Should be in error chain:\n" +
|
||||||
"expected: **assert.customError\n" +
|
"expected: *assert.customError\n" +
|
||||||
"in chain: \"abc: def\" (*fmt.wrapError)\n" +
|
"in chain: \"abc: def\" (*fmt.wrapError)\n" +
|
||||||
"\t\"def\" (*errors.errorString)\n",
|
"\t\"def\" (*errors.errorString)\n",
|
||||||
},
|
},
|
||||||
|
@ -3410,7 +3410,7 @@ func TestNotErrorAs(t *testing.T) {
|
||||||
result: false,
|
result: false,
|
||||||
resultErrMsg: "" +
|
resultErrMsg: "" +
|
||||||
"Target error should not be in err chain:\n" +
|
"Target error should not be in err chain:\n" +
|
||||||
"found: **assert.customError\n" +
|
"found: *assert.customError\n" +
|
||||||
"in chain: \"wrap: fail\" (*fmt.wrapError)\n" +
|
"in chain: \"wrap: fail\" (*fmt.wrapError)\n" +
|
||||||
"\t\"fail\" (*assert.customError)\n",
|
"\t\"fail\" (*assert.customError)\n",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue