summaryrefslogtreecommitdiff
path: root/spew/common_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'spew/common_test.go')
-rw-r--r--spew/common_test.go7
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 {