diff options
| author | Dave Collins <[email protected]> | 2013-01-20 13:41:53 -0600 |
|---|---|---|
| committer | Dave Collins <[email protected]> | 2013-01-20 13:41:53 -0600 |
| commit | 89496a6569e5cccff78a35628ab4057b11cf85a9 (patch) | |
| tree | 76b665ea26ade94f3ab90d9419ce308b1da71981 /spew/common_test.go | |
| parent | 57a610269f12551528d76bd46c84dbbb308cc49c (diff) | |
Add tests for types with custom Error interface.
Diffstat (limited to 'spew/common_test.go')
| -rw-r--r-- | spew/common_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spew/common_test.go b/spew/common_test.go index 78b1f81..f0119e6 100644 --- a/spew/common_test.go +++ b/spew/common_test.go @@ -58,6 +58,13 @@ func (p panicer) String() string { panic("test panic") } +// customError is used to test custom error interface invocation. +type customError int + +func (e customError) Error() string { + return fmt.Sprintf("error: %d", int(e)) +} + // stringizeWants converts a slice of wanted test output into a format suitable // for an test error message. func stringizeWants(wants []string) string { |
