()
| 827 | |
| 828 | #[test] |
| 829 | fn test_apply_delete() { |
| 830 | let mut txn = MockTxn::new(); |
| 831 | let mut context = ApplyContext::new(ApplyOptions::default()); |
| 832 | let trunk_id = create_test_trunk(&mut txn, 1); |
| 833 | let branch_id = BranchId::new(NodeId::new(1), 0); |
| 834 | |
| 835 | // Create first |
| 836 | let insert_op = BranchOp::Insert { |
| 837 | after: None, |
| 838 | content: vec![], |
| 839 | }; |
| 840 | apply_branch_op(&mut txn, &mut context, trunk_id, branch_id, &insert_op, &[]).unwrap(); |
| 841 | |
| 842 | // Delete |
| 843 | let delete_op = BranchOp::Delete { |
| 844 | branch: branch_id, |
| 845 | content: vec![], |
| 846 | }; |
| 847 | apply_branch_op(&mut txn, &mut context, trunk_id, branch_id, &delete_op, &[]).unwrap(); |
| 848 | |
| 849 | let branch = txn.get_branch(branch_id).unwrap().unwrap(); |
| 850 | assert!(branch.state().is_deleted()); |
| 851 | assert_eq!(context.stats().branches_deleted(), 1); |
| 852 | } |
| 853 | |
| 854 | #[test] |
| 855 | fn test_apply_delete_not_found() { |
nothing calls this directly
no test coverage detected