13 lines
469 B
Rust
13 lines
469 B
Rust
![]() |
use std::path::PathBuf;
|
||
|
use tempfile::TempDir;
|
||
|
|
||
|
/// Sets up a temporary directory and log file for testing
|
||
|
/// Returns:
|
||
|
/// - TempDir: The temporary directory (keep this in scope to prevent cleanup)
|
||
|
/// - PathBuf: Path to the log file
|
||
|
pub fn setup_test_log_file() -> (TempDir, PathBuf) {
|
||
|
let temp_dir = tempfile::TempDir::new().expect("Failed to create temporary directory for test");
|
||
|
let log_path = temp_dir.path().join("test.log");
|
||
|
(temp_dir, log_path)
|
||
|
}
|