mirror of
https://github.com/storytold/soundcraft.git
synced 2026-11-03 17:08:17 -06:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14dfebb01d | ||
|
|
a6be2b28f5 |
@@ -150,7 +150,9 @@ mod tests {
|
||||
fn tmp(name: &str) -> PathBuf {
|
||||
let d = std::env::temp_dir().join(format!("soundcraft-clap-scan-{name}-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&d);
|
||||
std::fs::create_dir_all(&d).unwrap();
|
||||
// Created exclusively: a folder still there after the cleanup (someone else's) would
|
||||
// let a link inside it redirect the test's writes.
|
||||
std::fs::create_dir(&d).unwrap();
|
||||
d
|
||||
}
|
||||
|
||||
|
||||
@@ -197,8 +197,11 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn a_failed_update_restores_the_manifest() {
|
||||
let root = std::env::temp_dir().join(format!("xtask-version-restore-{}", std::process::id()));
|
||||
std::fs::create_dir_all(&root).unwrap();
|
||||
// Created exclusively: a folder already there (planted, or left by a failed run) would be
|
||||
// someone else's, and a link inside it could redirect the writes below.
|
||||
let nanos = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map_or(0, |d| d.subsec_nanos());
|
||||
let root = std::env::temp_dir().join(format!("xtask-version-restore-{}-{nanos}", std::process::id()));
|
||||
std::fs::create_dir(&root).unwrap();
|
||||
let path = root.join("Cargo.toml");
|
||||
std::fs::write(&path, MANIFEST).unwrap();
|
||||
let err = set(&root, &path, MANIFEST, "2.0.0", || Err("cargo update failed".into())).unwrap_err();
|
||||
|
||||
Reference in New Issue
Block a user