Add conversion test for empty graph
This commit is contained in:
@@ -10,6 +10,7 @@ macro_rules! graph_topology_conversion_tests {
|
||||
($T:ty, $U:ty) => {
|
||||
$crate::graph_topology_conversion_tests!(@wrap $T, $U,
|
||||
convert,
|
||||
convert_empty,
|
||||
);
|
||||
};
|
||||
|
||||
@@ -41,3 +42,22 @@ where
|
||||
|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),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user