Move the disconnected test graph to the more general graph_topology_test_fixtures macro

This commit is contained in:
2026-06-25 20:17:55 +02:00
parent 3adfb4b9eb
commit e299012948
2 changed files with 14 additions and 13 deletions
+11
View File
@@ -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)
}
};
}