From f2641d5e6e2ffc7bb5d847b6552149f4f3b02136 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sun, 20 Jan 2013 19:55:55 -0600 Subject: Add tests for structs with multiple equiv fields. This commit adds tests for a struct which has an embedded struct pointer and a field that is a pointer to the same object. This ensures the cycle detection is properly reset between fields. --- spew/common_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'spew/common_test.go') diff --git a/spew/common_test.go b/spew/common_test.go index 4b786e6..0f1715d 100644 --- a/spew/common_test.go +++ b/spew/common_test.go @@ -59,6 +59,17 @@ type indirCir3 struct { ps1 *indirCir1 } +// embed is used to test embedded structures. +type embed struct { + a string +} + +// embedwrap is used to test embedded structures. +type embedwrap struct { + *embed + e *embed +} + // panicer is used to intentionally cause a panic for testing spew properly // handles them type panicer int -- cgit v1.2.3