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

Function test_workspace_stats_populated

atomic-core/src/apply/workspace.rs:1126–1153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1124
1125 #[test]
1126 fn test_workspace_stats_populated() {
1127 let mut workspace = Workspace::new();
1128
1129 workspace.add_up_context(Position::ROOT);
1130 workspace.add_down_context(Position::ROOT);
1131 workspace.add_pending_edge(Position::ROOT, Position::ROOT, EdgeFlags::BLOCK);
1132 workspace.mark_edge_deleted(Position::ROOT, Position::ROOT);
1133 workspace.add_missing_up_context(Position::ROOT);
1134 workspace.add_zombie_vertex(GraphNode::new(
1135 NodeId::new(1),
1136 ChangePosition::new(0),
1137 ChangePosition::new(10),
1138 ));
1139 workspace.mark_rooted(Position::ROOT);
1140
1141 let stats = workspace.stats();
1142
1143 assert_eq!(stats.up_context_count, 1);
1144 assert_eq!(stats.down_context_count, 1);
1145 assert_eq!(stats.pending_edge_count, 1);
1146 assert_eq!(stats.deleted_edge_count, 1);
1147 assert_eq!(stats.missing_context_count, 1);
1148 assert_eq!(stats.zombie_count, 1);
1149 assert_eq!(stats.rooted_count, 1);
1150
1151 assert!(!stats.is_empty());
1152 assert!(stats.total() > 0);
1153 }
1154
1155 #[test]
1156 fn test_workspace_stats_debug() {

Callers

nothing calls this directly

Calls 8

add_up_contextMethod · 0.80
add_down_contextMethod · 0.80
add_pending_edgeMethod · 0.80
mark_edge_deletedMethod · 0.80
mark_rootedMethod · 0.80
add_zombie_vertexMethod · 0.45
statsMethod · 0.45

Tested by

no test coverage detected