summaryrefslogtreecommitdiff
path: root/spew/spew_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'spew/spew_test.go')
-rw-r--r--spew/spew_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/spew/spew_test.go b/spew/spew_test.go
index 4978d0d..6101559 100644
--- a/spew/spew_test.go
+++ b/spew/spew_test.go
@@ -124,6 +124,7 @@ func initSpewTests() {
scsNoMethods := &spew.ConfigState{Indent: " ", DisableMethods: true}
scsNoPmethods := &spew.ConfigState{Indent: " ", DisablePointerMethods: true}
scsMaxDepth := &spew.ConfigState{Indent: " ", MaxDepth: 1}
+ scsContinue := &spew.ConfigState{Indent: " ", ContinueOnMethod: true}
// Variables for tests on types which implement Stringer interface with and
// without a pointer receiver.
@@ -141,6 +142,9 @@ func initSpewTests() {
dt := depthTester{indirCir1{nil}, [1]string{"arr"}, []string{"slice"},
map[string]int{"one": 1}}
+ // Variable for tests on types which implement error interface.
+ te := customError(10)
+
spewTests = []spewTest{
{scsDefault, fCSFdump, "", int8(127), "(int8) 127\n"},
{scsDefault, fCSFprint, "", int16(32767), "32767"},
@@ -175,6 +179,12 @@ func initSpewTests() {
" arr: ([1]string) {\n <max depth reached>\n },\n" +
" slice: ([]string) {\n <max depth reached>\n },\n" +
" m: (map[string]int) {\n <max depth reached>\n }\n}\n"},
+ {scsContinue, fCSFprint, "", ts, "(stringer test) test"},
+ {scsContinue, fCSFdump, "", ts, "(spew_test.stringer) " +
+ "(stringer test) \"test\"\n"},
+ {scsContinue, fCSFprint, "", te, "(error: 10) 10"},
+ {scsContinue, fCSFdump, "", te, "(spew_test.customError) " +
+ "(error: 10) 10\n"},
}
}