Add conversion test for empty graph

This commit is contained in:
2026-10-15 08:46:47 +02:00
parent eab5a63e6c
commit 9ae841288b
@@ -10,6 +10,7 @@ macro_rules! graph_topology_conversion_tests {
($T:ty, $U:ty) => { ($T:ty, $U:ty) => {
$crate::graph_topology_conversion_tests!(@wrap $T, $U, $crate::graph_topology_conversion_tests!(@wrap $T, $U,
convert, convert,
convert_empty,
); );
}; };
@@ -41,3 +42,22 @@ where
|e| iso.edge(e), |e| iso.edge(e),
); );
} }
pub fn convert_empty<G: GraphTopologyConversion, H: MakeTestGraph>()
where
G::Vertex: Debug,
G::Edge: Debug,
H::Vertex: Debug,
H::Edge: Debug,
{
let source = H::empty();
let (graph, iso) = G::convert(&source);
fixtures::assert_isomorphic(
&source,
&graph,
&[],
|v| iso.vertex(v),
&[],
|e| iso.edge(e),
);
}