Replace tempdir crate with tempfile

This commit is contained in:
Julian Braha 2024-01-24 17:58:09 +00:00
parent f8604e88ef
commit fd6f71d287
15 changed files with 78 additions and 119 deletions

View file

@ -32,4 +32,4 @@ smol.workspace = true
[dev-dependencies]
gpui = { path = "../gpui", features = ["test-support"] }
env_logger.workspace = true
tempdir.workspace = true
tempfile.workspace = true

View file

@ -196,7 +196,6 @@ mod tests {
use sqlez::domain::Domain;
use sqlez_macros::sql;
use tempdir::TempDir;
use crate::open_db;
@ -220,7 +219,10 @@ mod tests {
}
}
let tempdir = TempDir::new("DbTests").unwrap();
let tempdir = tempfile::Builder::new()
.prefix("DbTests")
.tempdir()
.unwrap();
let _bad_db = open_db::<BadDB>(tempdir.path(), &util::channel::ReleaseChannel::Dev).await;
}
@ -253,7 +255,10 @@ mod tests {
}
}
let tempdir = TempDir::new("DbTests").unwrap();
let tempdir = tempfile::Builder::new()
.prefix("DbTests")
.tempdir()
.unwrap();
{
let corrupt_db =
open_db::<CorruptedDB>(tempdir.path(), &util::channel::ReleaseChannel::Dev).await;
@ -297,7 +302,10 @@ mod tests {
}
}
let tempdir = TempDir::new("DbTests").unwrap();
let tempdir = tempfile::Builder::new()
.prefix("DbTests")
.tempdir()
.unwrap();
{
// Setup the bad database
let corrupt_db =