()
| 688 | |
| 689 | #[test] |
| 690 | fn test_apply_insert() { |
| 691 | let mut txn = MockTxn::new(); |
| 692 | let mut context = ApplyContext::new(ApplyOptions::default()); |
| 693 | let trunk_id = create_test_trunk(&mut txn, 1); |
| 694 | let branch_id = BranchId::new(NodeId::new(1), 0); |
| 695 | |
| 696 | let op = BranchOp::Insert { |
| 697 | after: None, |
| 698 | content: vec![], |
| 699 | }; |
| 700 | |
| 701 | apply_branch_op(&mut txn, &mut context, trunk_id, branch_id, &op, &[]).unwrap(); |
| 702 | |
| 703 | assert!(txn.has_branch(branch_id).unwrap()); |
| 704 | let branch = txn.get_branch(branch_id).unwrap().unwrap(); |
| 705 | assert_eq!(branch.trunk(), trunk_id); |
| 706 | assert!(branch.state().is_alive()); |
| 707 | assert_eq!(context.stats().branches_inserted(), 1); |
| 708 | } |
| 709 | |
| 710 | #[test] |
| 711 | fn test_apply_insert_after() { |
nothing calls this directly
no test coverage detected