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

Function three_way_fork

atomic-core/src/output/repo/fork.rs:306–331  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

304
305 #[test]
306 fn three_way_fork() {
307 let verts = [
308 GraphNode::BOTTOM,
309 make_vertex(1, 0, 10),
310 make_vertex(2, 0, 5),
311 make_vertex(3, 0, 7),
312 make_vertex(4, 0, 3),
313 ];
314 let graph = build_graph(&verts, 1, &[2, 3, 4]);
315
316 let order = OrderResult {
317 sccs: vec![
318 vec![VertexId(1)],
319 vec![VertexId(2)],
320 vec![VertexId(3)],
321 vec![VertexId(4)],
322 ],
323 conflict_tree: Default::default(),
324 cyclic_conflicts: 0,
325 forward_edges: Vec::new(),
326 };
327
328 let forks = detect_fork_conflicts(&graph, &order);
329 assert_eq!(forks.len(), 1);
330 assert_eq!(forks[0].children.len(), 3);
331 }
332
333 #[test]
334 fn no_children_at_all() {

Callers

nothing calls this directly

Calls 3

build_graphFunction · 0.85
detect_fork_conflictsFunction · 0.85
make_vertexFunction · 0.70

Tested by

no test coverage detected