()
| 875 | |
| 876 | #[test] |
| 877 | fn test_validate_path_available() { |
| 878 | let mut txn = MockTxn::new(); |
| 879 | let mut context = ApplyContext::new(ApplyOptions::default()); |
| 880 | let trunk_id = TrunkId::new(NodeId::new(1), 0); |
| 881 | |
| 882 | // Path is available before creating |
| 883 | validate_path_available(&txn, "test.rs", None).unwrap(); |
| 884 | |
| 885 | // Create a trunk |
| 886 | let create_op = TrunkOp::Create { |
| 887 | path: "test.rs".to_string(), |
| 888 | encoding: None, |
| 889 | }; |
| 890 | apply_trunk_op(&mut txn, &mut context, trunk_id, &create_op).unwrap(); |
| 891 | |
| 892 | // Path is now taken |
| 893 | let result = validate_path_available(&txn, "test.rs", None); |
| 894 | assert!(result.is_err()); |
| 895 | |
| 896 | // But available if we exclude the owner |
| 897 | validate_path_available(&txn, "test.rs", Some(trunk_id)).unwrap(); |
| 898 | } |
| 899 | } |
nothing calls this directly
no test coverage detected