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

Function test_graph_children_iterator

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

Source from the content-addressed store, hash-verified

612
613 #[test]
614 fn test_graph_children_iterator() {
615 let mut graph = AliveGraph::new();
616 graph.push_vertex(AliveVertex::DUMMY);
617
618 let v = GraphNode::new(
619 NodeId::new(1),
620 ChangePosition::new(0),
621 ChangePosition::new(10),
622 );
623 graph.push_vertex(AliveVertex::new(v));
624 graph.set_last_children_start();
625
626 let edge = SerializedGraphEdge::new(
627 EdgeFlags::BLOCK,
628 Position::new(NodeId::new(2), ChangePosition::new(0)),
629 NodeId::new(1),
630 );
631 graph.push_child_to_last(Some(edge), VertexId::new(2));
632 graph.push_child_to_last(None, VertexId::DUMMY);
633
634 let children: Vec<_> = graph.children(VertexId::new(1)).collect();
635 assert_eq!(children.len(), 2);
636 assert!(children[0].0.is_some());
637 assert!(children[1].0.is_none());
638 }
639
640 #[test]
641 fn test_graph_get_child() {

Callers

nothing calls this directly

Calls 4

push_vertexMethod · 0.80
push_child_to_lastMethod · 0.80
childrenMethod · 0.80

Tested by

no test coverage detected