//! Shared test harness for pinning `DIFFLORE_HOME` to one process-unique
//! tempdir. The single `unsafe` `set_var` and its SAFETY justification live
//! here so reviewers audit the isolation invariant in exactly one place
//! instead of in every test module that needs an isolated index DB.
// reason: `env::set_var` is unsafe in 2024 edition; the OnceLock invariant below makes it sound.
use OnceLock;
use TempDir;
/// Point `DIFFLORE_HOME` at a process-unique tempdir so the per-project index
/// DB is isolated per test process. Without it, parallel nextest processes
/// contend on a shared on-disk index DB ("database is locked").
///
/// Idempotent: the tempdir is created and the env var written exactly once per
/// process; the returned reference stays valid for the process lifetime.
pub