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

Function test_solve_name_conflict

atomic-core/src/change/graph_op.rs:978–995  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

976
977 #[test]
978 fn test_solve_name_conflict() {
979 let winner = Position::new(Hash::of(b"winner"), ChangePosition::new(7));
980 let graph_op =
981 GraphOp::solve_name_conflict("conflicted.txt", winner, [test_name_claim()]).unwrap();
982
983 assert!(graph_op.is_conflict_resolution());
984 assert_eq!(graph_op.path(), Some("conflicted.txt"));
985 let GraphOp::SolveNameConflict { name, .. } = graph_op else {
986 unreachable!();
987 };
988 assert_eq!(name.inode, winner);
989 assert_eq!(name.edges.len(), 1);
990 assert_eq!(name.edges[0].previous, EdgeFlags::FOLDER | EdgeFlags::BLOCK);
991 assert_eq!(
992 name.edges[0].flag,
993 EdgeFlags::FOLDER | EdgeFlags::BLOCK | EdgeFlags::DELETED
994 );
995 }
996
997 #[test]
998 fn test_unsolve_name_conflict_reverses_transition() {

Callers

nothing calls this directly

Calls 2

test_name_claimFunction · 0.85
unwrapMethod · 0.45

Tested by

no test coverage detected