use crate tempfile for test

master
WangRunji 6 years ago
parent f308d7bd6e
commit 16bf3302f8

@ -3,4 +3,4 @@ rust:
- nightly
script:
- cargo build
- cargo test --verbose -- --test-threads=1
- cargo test --verbose

@ -14,5 +14,8 @@ bit-vec = { default-features = false, git = "https://github.com/AltSysrq/bit-vec
static_assertions = "0.3"
spin = "0.4"
[dev-dependencies]
tempfile = "3"
[features]
std = []

@ -16,8 +16,7 @@ fn _open_sample_file() -> Arc<SimpleFileSystem> {
}
fn _create_new_sfs() -> Arc<SimpleFileSystem> {
let file = OpenOptions::new()
.read(true).write(true).create(true).open("test.img")
let file = tempfile::tempfile()
.expect("failed to create file");
SimpleFileSystem::create(Box::new(file), 32 * 4096)
}

Loading…
Cancel
Save