()
| 751 | |
| 752 | #[test] |
| 753 | fn test_graph_stats_with_content() { |
| 754 | let mut graph = AliveGraph::new(); |
| 755 | graph.push_vertex(AliveVertex::DUMMY); |
| 756 | |
| 757 | let v1 = GraphNode::new( |
| 758 | NodeId::new(1), |
| 759 | ChangePosition::new(0), |
| 760 | ChangePosition::new(100), |
| 761 | ); |
| 762 | graph.push_vertex(AliveVertex::new(v1)); |
| 763 | |
| 764 | let v2 = GraphNode::new( |
| 765 | NodeId::new(2), |
| 766 | ChangePosition::new(0), |
| 767 | ChangePosition::new(50), |
| 768 | ); |
| 769 | graph.push_vertex(AliveVertex::new(v2).with_flags(VertexFlags::ZOMBIE)); |
| 770 | |
| 771 | let stats = graph.stats(); |
| 772 | assert_eq!(stats.vertex_count, 3); |
| 773 | assert_eq!(stats.total_bytes, 150); |
| 774 | assert_eq!(stats.zombie_count, 1); |
| 775 | assert!(stats.has_conflicts()); |
| 776 | } |
| 777 | |
| 778 | #[test] |
| 779 | fn test_graph_stats_avg_calculations() { |
nothing calls this directly
no test coverage detected