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:775–796  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

apply_trunk_opFunction · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected