()
| 662 | |
| 663 | #[test] |
| 664 | fn test_graph_get_child() { |
| 665 | let mut graph = AliveGraph::new(); |
| 666 | graph.push_vertex(AliveVertex::DUMMY); |
| 667 | |
| 668 | let v = GraphNode::ROOT; |
| 669 | graph.push_vertex(AliveVertex::new(v)); |
| 670 | graph.set_last_children_start(); |
| 671 | |
| 672 | graph.push_child_to_last(None, VertexId::new(10)); |
| 673 | graph.push_child_to_last(None, VertexId::new(11)); |
| 674 | |
| 675 | let child0 = graph.get_child(VertexId::new(1), 0); |
| 676 | assert!(child0.is_some()); |
| 677 | assert_eq!(child0.unwrap().1, VertexId::new(10)); |
| 678 | |
| 679 | let child1 = graph.get_child(VertexId::new(1), 1); |
| 680 | assert_eq!(child1.unwrap().1, VertexId::new(11)); |
| 681 | |
| 682 | let child2 = graph.get_child(VertexId::new(1), 2); |
| 683 | assert!(child2.is_none()); |
| 684 | } |
| 685 | |
| 686 | #[test] |
| 687 | fn test_graph_add_extra_child() { |
nothing calls this directly
no test coverage detected