(t *testing.T)
| 34 | } |
| 35 | |
| 36 | func TestDijkstra(t *testing.T) { |
| 37 | for _, tc := range tc_dijkstra { |
| 38 | t.Run(tc.name, func(t *testing.T) { |
| 39 | var graph Graph |
| 40 | for _, edge := range tc.edges { |
| 41 | graph.AddWeightedEdge(edge[0], edge[1], edge[2]) |
| 42 | } |
| 43 | |
| 44 | actual, _ := graph.Dijkstra(tc.node0, tc.node1) |
| 45 | if actual != tc.expected { |
| 46 | t.Errorf("expected %d, got %d, from node %d to %d, with %v", |
| 47 | tc.expected, actual, tc.node0, tc.node1, tc.edges) |
| 48 | } |
| 49 | }) |
| 50 | } |
| 51 | } |
nothing calls this directly
no test coverage detected