summaryrefslogtreecommitdiff
path: root/spew/common_test.go
diff options
context:
space:
mode:
authorDave Collins <[email protected]>2013-01-20 17:53:55 -0600
committerDave Collins <[email protected]>2013-01-20 17:53:55 -0600
commit44d9c97c1ac1c523122fc4f0db8c0c364a3d1d45 (patch)
tree9e77d88379f16a44f23e4c7ab0c1f7175d609a24 /spew/common_test.go
parent6024e0c79eec3c66cc3e1807fc6169800d3c53ea (diff)
Add tests for disable method options.
This commit adds tests for the DisableMethods and DisablePointerMethods options. All combinations of method options and Stringer interface invocation for both pointer receivers and non-pointer receivers are tested.
Diffstat (limited to 'spew/common_test.go')
-rw-r--r--spew/common_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/spew/common_test.go b/spew/common_test.go
index f0119e6..4b786e6 100644
--- a/spew/common_test.go
+++ b/spew/common_test.go
@@ -20,6 +20,15 @@ import (
"fmt"
)
+// custom type to test Stinger interface on non-pointer receiver.
+type stringer string
+
+// String implements the Stringer interface for testing invocation of custom
+// stringers on types with non-pointer receivers.
+func (s stringer) String() string {
+ return "stringer " + string(s)
+}
+
// custom type to test Stinger interface on pointer receiver.
type pstringer string