()
| 980 | |
| 981 | #[test] |
| 982 | fn test_validate_branch_state() { |
| 983 | let mut txn = MockTxn::new(); |
| 984 | let mut context = ApplyContext::new(ApplyOptions::default()); |
| 985 | let trunk_id = create_test_trunk(&mut txn, 1); |
| 986 | let branch_id = BranchId::new(NodeId::new(1), 0); |
| 987 | |
| 988 | // Create a branch |
| 989 | let insert_op = BranchOp::Insert { |
| 990 | after: None, |
| 991 | content: vec![], |
| 992 | }; |
| 993 | apply_branch_op(&mut txn, &mut context, trunk_id, branch_id, &insert_op, &[]).unwrap(); |
| 994 | |
| 995 | // Validate alive state |
| 996 | let branch = validate_branch_state(&txn, branch_id, Some(BranchState::Alive)).unwrap(); |
| 997 | assert!(branch.state().is_alive()); |
| 998 | |
| 999 | // Should fail for deleted state |
| 1000 | let result = validate_branch_state(&txn, branch_id, Some(BranchState::Deleted)); |
| 1001 | assert!(result.is_err()); |
| 1002 | } |
| 1003 | |
| 1004 | #[test] |
| 1005 | fn test_validate_branch_parent() { |
nothing calls this directly
no test coverage detected