()
| 708 | |
| 709 | #[test] |
| 710 | fn test_apply_move_deleted() { |
| 711 | let mut txn = MockTxn::new(); |
| 712 | let mut context = ApplyContext::new(ApplyOptions::default()); |
| 713 | let trunk_id = TrunkId::new(NodeId::new(1), 0); |
| 714 | |
| 715 | // Create and delete |
| 716 | let create_op = TrunkOp::Create { |
| 717 | path: "test.rs".to_string(), |
| 718 | encoding: None, |
| 719 | }; |
| 720 | apply_trunk_op(&mut txn, &mut context, trunk_id, &create_op).unwrap(); |
| 721 | |
| 722 | let delete_op = TrunkOp::Delete { trunk: trunk_id }; |
| 723 | apply_trunk_op(&mut txn, &mut context, trunk_id, &delete_op).unwrap(); |
| 724 | |
| 725 | // Try to move |
| 726 | let move_op = TrunkOp::Move { |
| 727 | trunk: trunk_id, |
| 728 | new_path: "new.rs".to_string(), |
| 729 | }; |
| 730 | let result = apply_trunk_op(&mut txn, &mut context, trunk_id, &move_op); |
| 731 | |
| 732 | assert!(result.is_err()); |
| 733 | assert!(result.unwrap_err().is_invalid_state()); |
| 734 | } |
| 735 | |
| 736 | #[test] |
| 737 | fn test_apply_move_path_collision() { |
nothing calls this directly
no test coverage detected