()
| 639 | |
| 640 | #[test] |
| 641 | fn test_graph_get_child() { |
| 642 | let mut graph = AliveGraph::new(); |
| 643 | graph.push_vertex(AliveVertex::DUMMY); |
| 644 | |
| 645 | let v = GraphNode::ROOT; |
| 646 | graph.push_vertex(AliveVertex::new(v)); |
| 647 | graph.set_last_children_start(); |
| 648 | |
| 649 | graph.push_child_to_last(None, VertexId::new(10)); |
| 650 | graph.push_child_to_last(None, VertexId::new(11)); |
| 651 | |
| 652 | let child0 = graph.get_child(VertexId::new(1), 0); |
| 653 | assert!(child0.is_some()); |
| 654 | assert_eq!(child0.unwrap().1, VertexId::new(10)); |
| 655 | |
| 656 | let child1 = graph.get_child(VertexId::new(1), 1); |
| 657 | assert_eq!(child1.unwrap().1, VertexId::new(11)); |
| 658 | |
| 659 | let child2 = graph.get_child(VertexId::new(1), 2); |
| 660 | assert!(child2.is_none()); |
| 661 | } |
| 662 | |
| 663 | #[test] |
| 664 | fn test_graph_add_extra_child() { |
nothing calls this directly
no test coverage detected