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:
dasemuandClaude Sonnet 5.5 committed 2026-11-16 19:23:09 +01:00
1 parent 09fbf79e87
commit 00226b4178
9 files changed
+115 -48

No files matched your search

+3 -14
View File
@@ -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);