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

Function test_graph_child_count

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

Source from the content-addressed store, hash-verified

677
678 #[test]
679 fn test_graph_child_count() {
680 let mut graph = AliveGraph::new();
681 graph.push_vertex(AliveVertex::DUMMY);
682
683 let v = GraphNode::ROOT;
684 graph.push_vertex(AliveVertex::new(v));
685 graph.set_last_children_start();
686
687 graph.push_child_to_last(None, VertexId::new(1));
688 graph.push_child_to_last(None, VertexId::new(2));
689 graph.add_extra_child(VertexId::new(1), None, VertexId::new(3));
690
691 assert_eq!(graph.child_count(VertexId::new(1)), 3);
692 }
693
694 // -------------------------------------------------------------------------
695 // Iteration Tests

Callers

nothing calls this directly

Calls 4

push_vertexMethod · 0.80
push_child_to_lastMethod · 0.80
add_extra_childMethod · 0.80

Tested by

no test coverage detected