mirror of
https://github.com/Dasemu/Grove.git
synced 2026-11-27 07:46:13 +00:00
test(core): remove temp dirs after tests via shared RAII helper
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
09fbf79e87
commit
00226b4178
9 files changed
+115
-48
No files matched your search
@@ -1,20 +1,9 @@
|
||||
use grove_core::git::Git;
|
||||
use grove_core::snapshot::{Outcome, take};
|
||||
mod common;
|
||||
use common::tmpdir;
|
||||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
fn tmpdir(tag: &str) -> PathBuf {
|
||||
let p = std::env::temp_dir().join(format!(
|
||||
"grove-test-{tag}-{}-{}",
|
||||
std::process::id(),
|
||||
std::time::SystemTime::now()
|
||||
.duration_since(std::time::UNIX_EPOCH)
|
||||
.unwrap()
|
||||
.as_nanos()
|
||||
));
|
||||
fs::create_dir_all(&p).unwrap();
|
||||
p
|
||||
}
|
||||
use std::path::Path;
|
||||
|
||||
fn repo(dir: &Path) -> Git {
|
||||
let g = Git::new(dir);
|
||||
|
||||
Reference in new issue
Block a user