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:699–721  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

697
698 #[test]
699 fn test_graph_iter_vertices() {
700 let mut graph = AliveGraph::new();
701 graph.push_vertex(AliveVertex::DUMMY);
702
703 let v1 = GraphNode::new(
704 NodeId::new(1),
705 ChangePosition::new(0),
706 ChangePosition::new(10),
707 );
708 let v2 = GraphNode::new(
709 NodeId::new(2),
710 ChangePosition::new(0),
711 ChangePosition::new(20),
712 );
713 graph.push_vertex(AliveVertex::new(v1));
714 graph.push_vertex(AliveVertex::new(v2));
715
716 let vertices: Vec<_> = graph.iter_vertices().collect();
717 assert_eq!(vertices.len(), 3);
718 assert_eq!(vertices[0].0, VertexId::DUMMY);
719 assert_eq!(vertices[1].0, VertexId::new(1));
720 assert_eq!(vertices[2].0, VertexId::new(2));
721 }
722
723 #[test]
724 fn test_graph_iter_vertices_mut() {

Callers

nothing calls this directly

Calls 2

push_vertexMethod · 0.80
iter_verticesMethod · 0.80

Tested by

no test coverage detected