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:776–799  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

774
775 #[test]
776 fn test_graph_stats_with_content() {
777 let mut graph = AliveGraph::new();
778 graph.push_vertex(AliveVertex::DUMMY);
779
780 let v1 = GraphNode::new(
781 NodeId::new(1),
782 ChangePosition::new(0),
783 ChangePosition::new(100),
784 );
785 graph.push_vertex(AliveVertex::new(v1));
786
787 let v2 = GraphNode::new(
788 NodeId::new(2),
789 ChangePosition::new(0),
790 ChangePosition::new(50),
791 );
792 graph.push_vertex(AliveVertex::new(v2).with_flags(VertexFlags::ZOMBIE));
793
794 let stats = graph.stats();
795 assert_eq!(stats.vertex_count, 3);
796 assert_eq!(stats.total_bytes, 150);
797 assert_eq!(stats.zombie_count, 1);
798 assert!(stats.has_conflicts());
799 }
800
801 #[test]
802 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