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