()
| 860 | |
| 861 | #[test] |
| 862 | fn test_validate_trunk_state() { |
| 863 | let mut txn = MockTxn::new(); |
| 864 | let mut context = ApplyContext::new(ApplyOptions::default()); |
| 865 | let trunk_id = TrunkId::new(NodeId::new(1), 0); |
| 866 | |
| 867 | // Create a trunk |
| 868 | let create_op = TrunkOp::Create { |
| 869 | path: "test.rs".to_string(), |
| 870 | encoding: None, |
| 871 | }; |
| 872 | apply_trunk_op(&mut txn, &mut context, trunk_id, &create_op).unwrap(); |
| 873 | |
| 874 | // Validate alive state |
| 875 | let trunk = validate_trunk_state(&txn, trunk_id, Some(TrunkState::Alive)).unwrap(); |
| 876 | assert!(trunk.state().is_alive()); |
| 877 | |
| 878 | // Should fail for deleted state |
| 879 | let result = validate_trunk_state(&txn, trunk_id, Some(TrunkState::Deleted)); |
| 880 | assert!(result.is_err()); |
| 881 | } |
| 882 | |
| 883 | #[test] |
| 884 | fn test_validate_path_available() { |
nothing calls this directly
no test coverage detected