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

Function test_graph_vertex_access

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

Source from the content-addressed store, hash-verified

550
551 #[test]
552 fn test_graph_vertex_access() {
553 let mut graph = AliveGraph::new();
554 graph.push_vertex(AliveVertex::DUMMY);
555
556 let v = GraphNode::new(
557 NodeId::new(42),
558 ChangePosition::new(0),
559 ChangePosition::new(50),
560 );
561 graph.push_vertex(AliveVertex::new(v));
562
563 let vertex = graph.get_vertex(VertexId::new(1));
564 assert_eq!(vertex.node.change, NodeId::new(42));
565
566 let vertex_mut = graph.vertex_mut(VertexId::new(1));
567 vertex_mut.mark_visited();
568 assert!(graph.get_vertex(VertexId::new(1)).is_visited());
569 }
570
571 #[test]
572 fn test_graph_try_get_vertex() {

Callers

nothing calls this directly

Calls 4

push_vertexMethod · 0.80
get_vertexMethod · 0.80
vertex_mutMethod · 0.80
mark_visitedMethod · 0.80

Tested by

no test coverage detected