Skip to content

Commit ea52148

Browse files
committed
fix(plugins): use cross-platform temp directory in path test
Replace hardcoded /tmp with std::env::temp_dir() for Windows compatibility.
1 parent 59e1c91 commit ea52148

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/cortex-plugins/src/api.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -857,12 +857,13 @@ mod tests {
857857

858858
#[test]
859859
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")]);
860+
// Use a temp directory that works cross-platform
861+
let temp_dir = std::env::temp_dir();
862+
let host = PluginHostFunctions::new("test", temp_dir.clone())
863+
.with_allowed_paths(vec![temp_dir.clone()]);
863864

864-
// /tmp exists and should be allowed
865-
assert!(host.is_path_allowed(&PathBuf::from("/tmp")));
865+
// Temp dir should be allowed when explicitly added to allowlist
866+
assert!(host.is_path_allowed(&temp_dir));
866867
}
867868

868869
#[test]

0 commit comments

Comments
 (0)