Move the disconnected test graph to the more general graph_topology_test_fixtures macro
This commit is contained in:
@@ -87,6 +87,17 @@ macro_rules! graph_topology_test_fixtures {
|
||||
];
|
||||
(graph, vertices, edges, incidences)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn make_test_graph_disconnected()
|
||||
-> ($T, [<$T as $crate::traits::GraphTopology>::Vertex; 3]) {
|
||||
use $crate::traits::GraphTopology;
|
||||
let mut graph = <$T>::new();
|
||||
let vertices: [<$T as $crate::traits::GraphTopology>::Vertex; 3] =
|
||||
core::array::from_fn(|_| graph.add_vertex());
|
||||
graph.add_edge(vertices[1], vertices[2]);
|
||||
(graph, vertices)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user