Review Feedback

Squash of:
- including children in topologies_test.go
- report.Node.Prune should prune children also
- rewrote ShortLivedInternetConnections test to express its intent
- adding tests for detail Summary rendering
This commit is contained in:
Paul Bellamy
2016-03-24 13:43:19 +00:00
parent 2c6b6e6707
commit fe6203fd3f
18 changed files with 552 additions and 234 deletions

View File

@@ -219,8 +219,13 @@ func (n Node) Merge(other Node) Node {
// for rendering nodes and edges stripped away. Specifically, that means
// cutting out parts of the Node.
func (n Node) Prune() Node {
prunedChildren := MakeNodeSet()
n.Children.ForEach(func(child Node) {
prunedChildren = prunedChildren.Add(child.Prune())
})
return MakeNode().
WithID(n.ID).
WithTopology(n.Topology).
WithAdjacent(n.Adjacency.Copy()...)
WithAdjacent(n.Adjacency.Copy()...).
WithChildren(prunedChildren)
}