Add new assert helper function for GraphTopologyDeletion tests
This commit is contained in:
@@ -262,18 +262,16 @@ mod trait_tests {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::testing::fixtures::MakeTestGraph;
|
||||
|
||||
#[test]
|
||||
fn incident_vertices_paired_index() {
|
||||
let mut graph = AppendGraph::new();
|
||||
let v1 = graph.add_vertex();
|
||||
let v2 = graph.add_vertex();
|
||||
let e = graph.add_edge(v1, v2);
|
||||
let f = Edge(e.0 + 1);
|
||||
let (u1, u2) = graph.incident_vertices(f);
|
||||
let (graph, [v0, v1], e) = AppendGraph::single_edge();
|
||||
let f = Edge::new(e.index() + 1);
|
||||
let (u0, u1) = graph.incident_vertices(f);
|
||||
assert!(
|
||||
(u1 == v1 && u2 == v2) || (u1 == v2 && u2 == v1),
|
||||
"unexpected incident vertices {u1:?} and {u2:?} for edge {f:?}"
|
||||
(u0 == v0 && u1 == v1) || (u0 == v1 && u1 == v0),
|
||||
"unexpected incident vertices {u0:?} and {u1:?} for edge {f:?}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user