()
| 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() { |
nothing calls this directly
no test coverage detected