Skip to content

Commit

Permalink
test handling of address annotation of slices
Browse files Browse the repository at this point in the history
  • Loading branch information
kortschak committed Oct 20, 2018
1 parent 7beae16 commit e033871
Showing 1 changed file with 23 additions and 0 deletions.
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

0 comments on commit e033871

Please sign in to comment.