From 1fd0996375f6ca4aecab9b5089e5f30fcd1be241 Mon Sep 17 00:00:00 2001 From: pandaadir05 Date: Fri, 21 Nov 2025 15:29:12 +0200 Subject: [PATCH] fix: use platform-agnostic temp directory for test - Replace hardcoded /tmp path with std::env::temp_dir() - Fixes test_profile_persistence failure on Windows - Removes unused PathBuf import --- ghost-core/tests/anomaly_test.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ghost-core/tests/anomaly_test.rs b/ghost-core/tests/anomaly_test.rs index 5ee6342..b9567cb 100644 --- a/ghost-core/tests/anomaly_test.rs +++ b/ghost-core/tests/anomaly_test.rs @@ -1,5 +1,4 @@ use ghost_core::{AnomalyDetector, MemoryProtection, MemoryRegion, ProcessInfo}; -use std::path::PathBuf; #[test] fn test_anomaly_detector_creation() { @@ -94,7 +93,7 @@ fn test_profile_persistence() { let _ = detector.analyze_anomaly(&process, &features); } - let temp_path = PathBuf::from("/tmp/ghost_test_profiles.json"); + let temp_path = std::env::temp_dir().join("ghost_test_profiles.json"); let save_result = detector.save_profiles(&temp_path); assert!(