()
| 1053 | |
| 1054 | #[test] |
| 1055 | fn test_output_skips_empty_scc() { |
| 1056 | let content = b"Content\n"; |
| 1057 | let node = make_vertex(1, 0, content.len() as u64); |
| 1058 | let graph = make_simple_graph(node); |
| 1059 | |
| 1060 | // Order with an empty SCC (shouldn't happen, but handle gracefully) |
| 1061 | let order = OrderResult { |
| 1062 | sccs: vec![vec![], vec![VertexId(1)]], |
| 1063 | conflict_tree: Default::default(), |
| 1064 | cyclic_conflicts: 0, |
| 1065 | forward_edges: Vec::new(), |
| 1066 | }; |
| 1067 | |
| 1068 | let changes = MemoryChangeStore::new(); |
| 1069 | let change = make_change(content); |
| 1070 | let hash = change.hash().unwrap(); |
| 1071 | changes.insert(hash, change); |
| 1072 | |
| 1073 | let hash_fn = |id: NodeId| { |
| 1074 | if id.get() == 1 { |
| 1075 | Some(hash) |
| 1076 | } else { |
| 1077 | None |
| 1078 | } |
| 1079 | }; |
| 1080 | |
| 1081 | let mut buffer = Vec::new(); |
| 1082 | { |
| 1083 | let pos = Position::ROOT; |
| 1084 | let mut writer = ConflictWriter::new(&mut buffer, "test.rs", pos); |
| 1085 | |
| 1086 | let result = output_graph_content(&changes, hash_fn, &graph, &order, &mut writer); |
| 1087 | assert!(result.is_ok()); |
| 1088 | } |
| 1089 | assert_eq!(&buffer, content); |
| 1090 | } |
| 1091 | |
| 1092 | // ------------------------------------------------------------------------ |
| 1093 | // Missing Span Tests |
nothing calls this directly
no test coverage detected