()
| 737 | |
| 738 | #[test] |
| 739 | fn test_apply_insert_duplicate_id() { |
| 740 | let mut txn = MockTxn::new(); |
| 741 | let mut context = ApplyContext::new(ApplyOptions::default()); |
| 742 | let trunk_id = create_test_trunk(&mut txn, 1); |
| 743 | let branch_id = BranchId::new(NodeId::new(1), 0); |
| 744 | |
| 745 | let op = BranchOp::Insert { |
| 746 | after: None, |
| 747 | content: vec![], |
| 748 | }; |
| 749 | |
| 750 | apply_branch_op(&mut txn, &mut context, trunk_id, branch_id, &op, &[]).unwrap(); |
| 751 | |
| 752 | // Try to insert again with same ID |
| 753 | let result = apply_branch_op(&mut txn, &mut context, trunk_id, branch_id, &op, &[]); |
| 754 | assert!(result.is_err()); |
| 755 | assert!(result.unwrap_err().is_already_exists()); |
| 756 | } |
| 757 | |
| 758 | #[test] |
| 759 | fn test_apply_insert_duplicate_id_lenient() { |
nothing calls this directly
no test coverage detected