()
| 629 | |
| 630 | #[test] |
| 631 | fn test_apply_delete() { |
| 632 | let mut txn = MockTxn::new(); |
| 633 | let mut context = ApplyContext::new(ApplyOptions::default()); |
| 634 | let trunk_id = TrunkId::new(NodeId::new(1), 0); |
| 635 | |
| 636 | // Create first |
| 637 | let create_op = TrunkOp::Create { |
| 638 | path: "test.rs".to_string(), |
| 639 | encoding: None, |
| 640 | }; |
| 641 | apply_trunk_op(&mut txn, &mut context, trunk_id, &create_op).unwrap(); |
| 642 | |
| 643 | // Delete |
| 644 | let delete_op = TrunkOp::Delete { trunk: trunk_id }; |
| 645 | apply_trunk_op(&mut txn, &mut context, trunk_id, &delete_op).unwrap(); |
| 646 | |
| 647 | let trunk = txn.get_trunk(trunk_id).unwrap().unwrap(); |
| 648 | assert!(trunk.state().is_deleted()); |
| 649 | assert_eq!(context.stats().trunks_deleted(), 1); |
| 650 | } |
| 651 | |
| 652 | #[test] |
| 653 | fn test_apply_delete_not_found() { |
nothing calls this directly
no test coverage detected