MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_graph_iter_vertices

Function test_graph_iter_vertices

atomic-core/src/output/alive/graph.rs:722–744  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

720
721 #[test]
722 fn test_graph_iter_vertices() {
723 let mut graph = AliveGraph::new();
724 graph.push_vertex(AliveVertex::DUMMY);
725
726 let v1 = GraphNode::new(
727 NodeId::new(1),
728 ChangePosition::new(0),
729 ChangePosition::new(10),
730 );
731 let v2 = GraphNode::new(
732 NodeId::new(2),
733 ChangePosition::new(0),
734 ChangePosition::new(20),
735 );
736 graph.push_vertex(AliveVertex::new(v1));
737 graph.push_vertex(AliveVertex::new(v2));
738
739 let vertices: Vec<_> = graph.iter_vertices().collect();
740 assert_eq!(vertices.len(), 3);
741 assert_eq!(vertices[0].0, VertexId::DUMMY);
742 assert_eq!(vertices[1].0, VertexId::new(1));
743 assert_eq!(vertices[2].0, VertexId::new(2));
744 }
745
746 #[test]
747 fn test_graph_iter_vertices_mut() {

Callers

nothing calls this directly

Calls 3

push_vertexMethod · 0.80
iter_verticesMethod · 0.80
collectMethod · 0.45

Tested by

no test coverage detected