()
| 264 | |
| 265 | #[test] |
| 266 | fn graph_split_minimizes_cross_edges() { |
| 267 | // Chain: a→b→c→d→e. Splitting at midpoint should produce |
| 268 | // fewer cross-edges than random split. |
| 269 | let nodes: Vec<String> = vec!["a", "b", "c", "d", "e"] |
| 270 | .into_iter() |
| 271 | .map(|s| s.to_string()) |
| 272 | .collect(); |
| 273 | let edges: Vec<(String, String)> = vec![ |
| 274 | ("a".into(), "b".into()), |
| 275 | ("b".into(), "c".into()), |
| 276 | ("c".into(), "d".into()), |
| 277 | ("d".into(), "e".into()), |
| 278 | ]; |
| 279 | let plan = plan_graph_split(10, 20, 3, &nodes, &edges); |
| 280 | // 5 nodes split: mid = 5/2 = 2, so 3 docs move (5 - 2). |
| 281 | assert_eq!(plan.documents_to_move.len(), 3); |
| 282 | assert_eq!(plan.strategy, SplitStrategy::GraphCommunity); |
| 283 | } |
| 284 | |
| 285 | #[test] |
| 286 | fn graph_split_empty() { |
nothing calls this directly
no test coverage detected