Fixup gonum.org/v1/gonum/graph API calls

This commit is contained in:
Jordan Liggitt 2019-04-06 11:04:42 -04:00
parent 27030079f3
commit bba9f5e673
2 changed files with 5 additions and 5 deletions

View File

@ -268,7 +268,7 @@ func (h *debugHTTPHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
graph = h.controller.dependencyGraphBuilder.uidToNode.ToGonumGraph()
}
data, err := dot.Marshal(graph, "full", "", " ", false)
data, err := dot.Marshal(graph, "full", "", " ")
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return

View File

@ -439,8 +439,8 @@ func TestToGonumGraphObj(t *testing.T) {
func compareGraphs(expected, actual graph.Directed, t *testing.T) {
// sort the edges by from ID, then to ID
// (the slices we get back are from map iteration, where order is not guaranteed)
expectedNodes := expected.Nodes()
actualNodes := actual.Nodes()
expectedNodes := expected.Nodes().(graph.NodeSlicer).NodeSlice()
actualNodes := actual.Nodes().(graph.NodeSlicer).NodeSlice()
sort.Sort(gonumByUID(expectedNodes))
sort.Sort(gonumByUID(actualNodes))
@ -455,8 +455,8 @@ func compareGraphs(expected, actual graph.Directed, t *testing.T) {
t.Errorf("expected %v, got %v", spew.Sdump(currExpected), spew.Sdump(currActual))
}
expectedFrom := append([]graph.Node{}, expected.From(expectedNodes[i].ID())...)
actualFrom := append([]graph.Node{}, actual.From(actualNodes[i].ID())...)
expectedFrom := append([]graph.Node{}, expected.From(expectedNodes[i].ID()).(graph.NodeSlicer).NodeSlice()...)
actualFrom := append([]graph.Node{}, actual.From(actualNodes[i].ID()).(graph.NodeSlicer).NodeSlice()...)
sort.Sort(gonumByUID(expectedFrom))
sort.Sort(gonumByUID(actualFrom))
if len(expectedFrom) != len(actualFrom) {