We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 59e1c91 commit ea52148Copy full SHA for ea52148
1 file changed
src/cortex-plugins/src/api.rs
@@ -857,12 +857,13 @@ mod tests {
857
858
#[test]
859
fn test_host_functions_path_allowed_with_explicit_allowlist() {
860
- // Use /tmp as cwd which should exist on most systems
861
- let host = PluginHostFunctions::new("test", PathBuf::from("/tmp"))
862
- .with_allowed_paths(vec![PathBuf::from("/tmp")]);
+ // Use a temp directory that works cross-platform
+ let temp_dir = std::env::temp_dir();
+ let host = PluginHostFunctions::new("test", temp_dir.clone())
863
+ .with_allowed_paths(vec![temp_dir.clone()]);
864
- // /tmp exists and should be allowed
865
- assert!(host.is_path_allowed(&PathBuf::from("/tmp")));
+ // Temp dir should be allowed when explicitly added to allowlist
866
+ assert!(host.is_path_allowed(&temp_dir));
867
}
868
869
0 commit comments