()
| 548 | |
| 549 | #[test] |
| 550 | fn test_apply_create_duplicate_id() { |
| 551 | let mut txn = MockTxn::new(); |
| 552 | let mut context = ApplyContext::new(ApplyOptions::default()); |
| 553 | let trunk_id = TrunkId::new(NodeId::new(1), 0); |
| 554 | |
| 555 | let op = TrunkOp::Create { |
| 556 | path: "test.rs".to_string(), |
| 557 | encoding: None, |
| 558 | }; |
| 559 | |
| 560 | apply_trunk_op(&mut txn, &mut context, trunk_id, &op).unwrap(); |
| 561 | |
| 562 | // Try to create again with same ID |
| 563 | let op2 = TrunkOp::Create { |
| 564 | path: "other.rs".to_string(), |
| 565 | encoding: None, |
| 566 | }; |
| 567 | |
| 568 | let result = apply_trunk_op(&mut txn, &mut context, trunk_id, &op2); |
| 569 | assert!(result.is_err()); |
| 570 | assert!(result.unwrap_err().is_already_exists()); |
| 571 | } |
| 572 | |
| 573 | #[test] |
| 574 | fn test_apply_create_duplicate_id_lenient() { |
nothing calls this directly
no test coverage detected