Initial release #1

Merged
warrence merged 102 commits from dev into main 2026-06-30 10:26:52 +02:00
Showing only changes of commit c147ed4974 - Show all commits
+8 -5
View File
@@ -141,18 +141,21 @@ macro_rules! bfs_tests {
use $crate::traits::GraphTopology;
let mut graph = <$T>::new();
let v = graph.add_vertex();
let result = $crate::algorithms::bfs_find_where(&graph, v, |u| u == v);
assert_eq!(result, Some((v, 0)), "source should match with distance 0");
assert_eq!(
$crate::algorithms::bfs_find_where(&graph, v, |u| u == v),
Some((v, 0)),
"source should match with distance 0"
);
}
#[test]
fn bfs_find_where_disconnected() {
let (graph, vertices) = make_test_graph_disconnected();
let target = vertices[1];
assert_eq!(
$crate::algorithms::bfs_find_where(&graph, vertices[0], |v| v == target),
$crate::algorithms::bfs_find_where(&graph, vertices[0], |v| v == vertices[1]),
None,
"disconnected vertex should not be found"
"disconnected vertex {:?} should not be found",
vertices[1]
);
}