Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle address annotation of slices #13

Merged
merged 1 commit into from
Oct 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions dump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1059,11 +1059,34 @@ var mapElementCycles = []struct {
},
},
}
`,
},
// The following test is to confirm that the recursion detection
// is not overly zealous by missing identifying the address of slices.
// This is https://github.com/kortschak/utter/issues/12.
{
v: map[interface{}][]interface{}{
"outer": []interface{}{
map[interface{}]interface{}{
"inner": []interface{}{"value"},
},
},
},
want: `map[interface{}][]interface{}{
string("outer"): []interface{}{
map[interface{}]interface{}{
string("inner"): []interface{}{
string("value"),
},
},
},
}
`,
},
}

// https://github.com/kortschak/utter/issues/5
// https://github.com/kortschak/utter/issues/12
func TestIssue5Maps(t *testing.T) {
for _, test := range mapElementCycles {
w := newLimitedWriter(512)
Expand Down