You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TestAssertionFailure: retain full error chain in message
so far the conversion from an `Error` to a `TestAssertionFailure` meant
that all information about the source errors were lost. often, the
`Display` implementation for `Error` implementations does not include
the source information since that should instead be retrieved via
`source`. while this has not yet been made into an official API
guideline (see [rust-lang/api-guidelines#210]) this is nevertheless
being followed.
various crates like `anyhow` or `eyere` take care of pretty-printing the
error chain on failure, however this does not work with `googletest`
since `googletest::Result` has `TestAssertionFailure` as the error type
which swallows any `Error` and only keeps the message.
to resolve this a simple error chain implementation is added to the
`From` implementation which pretty-prints the error chain.
example:
```
Error: test3
Caused by:
1: test2
2: test1
```
fixesgoogle#657
[rust-lang/api-guidelines#210]: rust-lang/api-guidelines#210
0 commit comments