Adds testFormatCompleteCompare as additional testing func.
The new function takes a string slice as "want", wherein
stacktraces and non-stacktrace messages are discerned by
strings.ContainsAny(want[i], "\n").
For example usage, see TestFormatWithStack & TestFormatWithMessage.
Introduces WithMessage as well as errors.fundamental, errors.withMessage
and errors.withStack internal types.
Adjust tests for the new wrapped format when combining fundamental and
wrapped errors.
* Extended stacktrace output
* Make format tests less sensitive to sourcecode prefix
* use testFormatRegexp for all Sprintf tests
* replace output test with sample output
* work around the different fn.Name format in go 1.4
* fix windows tests when there is a drive letter in the source path
* Use fmt.Formatter throughout
Replace Fprintf with fmt.Formatter logic on various types. This
effectively guts Fprint to be just a recursive call down the err.Cause
chain. The next step will be to move this recursive logic into
wrapper.Format.
This change necessitates adding types for the error impls returned from
New and Errorf, and Wrap and Wrapf, respectively. The name of the latter
type is acceptable, the former is not and alternative suggestions are
encouraged.
- Remove cause.Format
- Added fmt.Formatter tests. The location is temporary, once this PR is merged and Fprint removed
they will be merged into errors_test.go