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