From f41b77903f1993c68a925de5665788353b641efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20M=C3=BCller?= Date: Fri, 16 Oct 2026 20:23:58 +0200 Subject: [PATCH] Add docs for MakeTestGraph generator methods --- src/testing/fixtures.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/testing/fixtures.rs b/src/testing/fixtures.rs index b118fe7..51382ec 100644 --- a/src/testing/fixtures.rs +++ b/src/testing/fixtures.rs @@ -5,6 +5,7 @@ use crate::models::{AppendGraph, FrozenGraph}; use crate::traits::{GraphTopology, GraphTopologyAddition, GraphTopologyConversion, Incidence}; pub trait MakeTestGraph: GraphTopology + Sized { + /// Returns a versatile, pre-defined standard test graph. // Since this is only a test fixture, the complex return type here is deemed acceptable. #[allow(clippy::type_complexity)] fn standard() -> ( @@ -14,20 +15,32 @@ pub trait MakeTestGraph: GraphTopology + Sized { [Vec>; 10], ); + /// Returns an empty graph. fn empty() -> Self; + /// Returns a graph with a single vertex and no edges. fn single_vertex() -> (Self, Self::Vertex); + /// Returns a graph with two vertices connected by a single edge. fn single_edge() -> (Self, [Self::Vertex; 2], Self::Edge); + /// Returns a graph with vertices *v0*, *v1*, and *v2*, where *v0* is isolated, and the other + /// two are connected by a single edge. fn disconnected() -> (Self, [Self::Vertex; 3]); + /// Returns a graph with a single vertex that has a single loop edge. fn loop_edge() -> (Self, Self::Vertex, Self::Edge); + /// Returns a graph with two vertices that are connected by `K` multi-edges. fn multiple_edges() -> (Self, [Self::Vertex; 2], [Self::Edge; K]); + /// Returns a graph that is a path with three vertices and two edges between them, returned in + /// order. fn two_edge_path() -> (Self, [Self::Vertex; 3], [Self::Edge; 2]); + /// Returns a graph that is a path with three vertices *v0*, *v1*, and *v2*, and two edges + /// *e0 = (v0, v1)* and *e1 = (v1, v2)* between them, and two loops on the first two vertices + /// *e2 = (v0, v0)* and *e3 = (v1, v1)*. fn two_edge_path_with_loops() -> (Self, [Self::Vertex; 3], [Self::Edge; 4]); }