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