()
| 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() { |
nothing calls this directly
no test coverage detected