Skip to content

Commit

Permalink
Reproduce GitHub issue #7
Browse files Browse the repository at this point in the history
  • Loading branch information
andreacorbellini committed Apr 9, 2024
1 parent 20be0a0 commit 3b15106
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ rand = { version = "0.8" }
[target.'cfg(unix)'.dependencies]
nix = { version = "0.28", features = ["fs", "user"] }

[dev-dependencies]
tempfile = { version = "3.10.1" }

[features]
default = ["unnamed-tmpfile"]

Expand Down
8 changes: 8 additions & 0 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,11 @@ fn creates_named_temporary_files() -> Result<()> {
verify_temporary_file_name("foo", temp_file_name);
file.commit()
}

#[test]
fn named_temp_file() -> Result<()> {
let file = tempfile::NamedTempFile::new()?;
let path = file.path();
let atomic = AtomicWriteFile::open(path)?;
atomic.commit()
}

0 comments on commit 3b15106

Please sign in to comment.