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

Source from the content-addressed store, hash-verified

527
528 #[test]
529 fn test_graph_vertex_access() {
530 let mut graph = AliveGraph::new();
531 graph.push_vertex(AliveVertex::DUMMY);
532
533 let v = GraphNode::new(
534 NodeId::new(42),
535 ChangePosition::new(0),
536 ChangePosition::new(50),
537 );
538 graph.push_vertex(AliveVertex::new(v));
539
540 let vertex = graph.get_vertex(VertexId::new(1));
541 assert_eq!(vertex.node.change, NodeId::new(42));
542
543 let vertex_mut = graph.vertex_mut(VertexId::new(1));
544 vertex_mut.mark_visited();
545 assert!(graph.get_vertex(VertexId::new(1)).is_visited());
546 }
547
548 #[test]
549 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