MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_graph_stats_with_content

Function test_graph_stats_with_content

atomic-core/src/output/alive/graph.rs:753–776  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 3

push_vertexMethod · 0.80
with_flagsMethod · 0.80
statsMethod · 0.45

Tested by

no test coverage detected