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

Function test_graph_children_with_extra

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

Source from the content-addressed store, hash-verified

921
922 #[test]
923 fn test_graph_children_with_extra() {
924 let mut graph = AliveGraph::new();
925 graph.push_vertex(AliveVertex::DUMMY);
926
927 let v = GraphNode::ROOT;
928 graph.push_vertex(AliveVertex::new(v));
929 graph.set_last_children_start();
930
931 // Regular children
932 graph.push_child_to_last(None, VertexId::new(10));
933
934 // Extra children
935 graph.add_extra_child(VertexId::new(1), None, VertexId::new(20));
936 graph.add_extra_child(VertexId::new(1), None, VertexId::new(21));
937
938 // Iterate all children
939 let children: Vec<_> = graph.children(VertexId::new(1)).collect();
940 assert_eq!(children.len(), 3);
941 }
942
943 #[test]
944 fn test_graph_replace_child_in_range_and_extra() {

Callers

nothing calls this directly

Calls 6

push_vertexMethod · 0.80
push_child_to_lastMethod · 0.80
add_extra_childMethod · 0.80
childrenMethod · 0.80
collectMethod · 0.45

Tested by

no test coverage detected