()
| 1086 | |
| 1087 | #[test] |
| 1088 | fn test_output_skips_empty_scc() { |
| 1089 | let content = b"Content\n"; |
| 1090 | let node = make_vertex(1, 0, content.len() as u64); |
| 1091 | let graph = make_simple_graph(node); |
| 1092 | |
| 1093 | // Order with an empty SCC (shouldn't happen, but handle gracefully) |
| 1094 | let order = OrderResult { |
| 1095 | sccs: vec![vec![], vec![VertexId(1)]], |
| 1096 | conflict_tree: Default::default(), |
| 1097 | cyclic_conflicts: 0, |
| 1098 | forward_edges: Vec::new(), |
| 1099 | }; |
| 1100 | |
| 1101 | let changes = MemoryChangeStore::new(); |
| 1102 | let change = make_change(content); |
| 1103 | let hash = change.hash().unwrap(); |
| 1104 | changes.insert(hash, change); |
| 1105 | |
| 1106 | let hash_fn = |id: NodeId| { |
| 1107 | if id.get() == 1 { |
| 1108 | Some(hash) |
| 1109 | } else { |
| 1110 | None |
| 1111 | } |
| 1112 | }; |
| 1113 | |
| 1114 | let mut buffer = Vec::new(); |
| 1115 | { |
| 1116 | let pos = Position::ROOT; |
| 1117 | let mut writer = ConflictWriter::new(&mut buffer, "test.rs", pos); |
| 1118 | |
| 1119 | let result = output_graph_content(&changes, hash_fn, &graph, &order, &mut writer); |
| 1120 | assert!(result.is_ok()); |
| 1121 | } |
| 1122 | assert_eq!(&buffer, content); |
| 1123 | } |
| 1124 | |
| 1125 | // ------------------------------------------------------------------------ |
| 1126 | // Missing Span Tests |
nothing calls this directly
no test coverage detected