-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -344,10 +344,13 @@ mod tests { | |
weight: Weight, | ||
nodes: Vec<NodeId>, | ||
) { | ||
let dijkstra_path = dijkstra.calc_path(&graph, source, target); | ||
assert_eq!( | ||
dijkstra.calc_path(&graph, source, target), | ||
Some(ShortestPath::new(source, target, weight, nodes)) | ||
dijkstra_path, | ||
Some(ShortestPath::new(source, target, weight, nodes.clone())) | ||
); | ||
// ShortestPath PartialEq does not consider nodes! | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dabreegster
Contributor
|
||
assert_eq!(nodes, dijkstra_path.unwrap().get_nodes().clone()); | ||
assert_eq!(dijkstra.calc_weight(&graph, source, target), Some(weight)); | ||
} | ||
} |
This is ugly. I think I now regret not including the nodes in ShortestPath PartialEq. @dabreegster do you have an opinion here? Should we add the nodes to the equality check? Or maybe remove ShortestPath PartialEq altogether?