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

Function test_apply_move_same_path

atomic-core/src/crdt/apply/trunk.rs:768–789  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

766
767 #[test]
768 fn test_apply_move_same_path() {
769 let mut txn = MockTxn::new();
770 let mut context = ApplyContext::new(ApplyOptions::default());
771 let trunk_id = TrunkId::new(NodeId::new(1), 0);
772
773 // Create
774 let create_op = TrunkOp::Create {
775 path: "test.rs".to_string(),
776 encoding: None,
777 };
778 apply_trunk_op(&mut txn, &mut context, trunk_id, &create_op).unwrap();
779
780 // Move to same path (no-op)
781 let move_op = TrunkOp::Move {
782 trunk: trunk_id,
783 new_path: "test.rs".to_string(),
784 };
785 apply_trunk_op(&mut txn, &mut context, trunk_id, &move_op).unwrap();
786
787 assert_eq!(context.stats().operations_skipped(), 1);
788 assert_eq!(context.stats().trunks_moved(), 0);
789 }
790
791 // Undelete Tests
792

Callers

nothing calls this directly

Calls 2

apply_trunk_opFunction · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected