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

Source from the content-addressed store, hash-verified

898
899 #[test]
900 fn test_graph_children_with_extra() {
901 let mut graph = AliveGraph::new();
902 graph.push_vertex(AliveVertex::DUMMY);
903
904 let v = GraphNode::ROOT;
905 graph.push_vertex(AliveVertex::new(v));
906 graph.set_last_children_start();
907
908 // Regular children
909 graph.push_child_to_last(None, VertexId::new(10));
910
911 // Extra children
912 graph.add_extra_child(VertexId::new(1), None, VertexId::new(20));
913 graph.add_extra_child(VertexId::new(1), None, VertexId::new(21));
914
915 // Iterate all children
916 let children: Vec<_> = graph.children(VertexId::new(1)).collect();
917 assert_eq!(children.len(), 3);
918 }
919
920 #[test]
921 fn test_graph_debug() {

Callers

nothing calls this directly

Calls 5

push_vertexMethod · 0.80
push_child_to_lastMethod · 0.80
add_extra_childMethod · 0.80
childrenMethod · 0.80

Tested by

no test coverage detected