|
@@ -130,12 +130,19 @@ func initSpewTests() {
|
|
|
scsNoPmethods := &spew.ConfigState{Indent: " ", DisablePointerMethods: true}
|
|
scsNoPmethods := &spew.ConfigState{Indent: " ", DisablePointerMethods: true}
|
|
|
scsMaxDepth := &spew.ConfigState{Indent: " ", MaxDepth: 1}
|
|
scsMaxDepth := &spew.ConfigState{Indent: " ", MaxDepth: 1}
|
|
|
scsContinue := &spew.ConfigState{Indent: " ", ContinueOnMethod: true}
|
|
scsContinue := &spew.ConfigState{Indent: " ", ContinueOnMethod: true}
|
|
|
|
|
+ scsNoPtrAddr := &spew.ConfigState{DisablePointerAddresses: true}
|
|
|
|
|
+ scsNoCap := &spew.ConfigState{DisableCapacities: true}
|
|
|
|
|
|
|
|
// Variables for tests on types which implement Stringer interface with and
|
|
// Variables for tests on types which implement Stringer interface with and
|
|
|
// without a pointer receiver.
|
|
// without a pointer receiver.
|
|
|
ts := stringer("test")
|
|
ts := stringer("test")
|
|
|
tps := pstringer("test")
|
|
tps := pstringer("test")
|
|
|
|
|
|
|
|
|
|
+ type ptrTester struct {
|
|
|
|
|
+ s *struct{}
|
|
|
|
|
+ }
|
|
|
|
|
+ tptr := &ptrTester{s: &struct{}{}}
|
|
|
|
|
+
|
|
|
// depthTester is used to test max depth handling for structs, array, slices
|
|
// depthTester is used to test max depth handling for structs, array, slices
|
|
|
// and maps.
|
|
// and maps.
|
|
|
type depthTester struct {
|
|
type depthTester struct {
|
|
@@ -192,6 +199,10 @@ func initSpewTests() {
|
|
|
{scsContinue, fCSFprint, "", te, "(error: 10) 10"},
|
|
{scsContinue, fCSFprint, "", te, "(error: 10) 10"},
|
|
|
{scsContinue, fCSFdump, "", te, "(spew_test.customError) " +
|
|
{scsContinue, fCSFdump, "", te, "(spew_test.customError) " +
|
|
|
"(error: 10) 10\n"},
|
|
"(error: 10) 10\n"},
|
|
|
|
|
+ {scsNoPtrAddr, fCSFprint, "", tptr, "<*>{<*>{}}"},
|
|
|
|
|
+ {scsNoPtrAddr, fCSSdump, "", tptr, "(*spew_test.ptrTester)({\ns: (*struct {})({\n})\n})\n"},
|
|
|
|
|
+ {scsNoCap, fCSSdump, "", make([]string, 0, 10), "([]string) {\n}\n"},
|
|
|
|
|
+ {scsNoCap, fCSSdump, "", make([]string, 1, 10), "([]string) (len=1) {\n(string) \"\"\n}\n"},
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|