mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-28 20:18:06 -06:00
Integration: #2699 describe the read-only refusal in the Windows staging test
This commit is contained in:
@@ -1226,8 +1226,8 @@ mod tests {
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// Windows refuses to replace a read-only file, so the rename fails: the staging file must not
|
||||
/// be left behind.
|
||||
/// A read-only target is refused before anything is staged, so no staging file is left
|
||||
/// behind.
|
||||
#[cfg(windows)]
|
||||
#[test]
|
||||
fn a_failed_save_removes_the_staging_file() {
|
||||
@@ -1238,7 +1238,7 @@ mod tests {
|
||||
perms.set_readonly(true);
|
||||
std::fs::set_permissions(&target, perms.clone()).unwrap();
|
||||
let e = write_atomically_with(&target.to_string_lossy(), b"NEW", [7]).unwrap_err();
|
||||
assert_eq!(e.kind(), std::io::ErrorKind::PermissionDenied, "the rename failed: {e}");
|
||||
assert_eq!(e.kind(), std::io::ErrorKind::PermissionDenied, "a read-only target is refused: {e}");
|
||||
assert_eq!(read(&target), "OLD");
|
||||
assert_eq!(listing(&dir), ["out.pdf"], "the staging file was removed");
|
||||
#[allow(clippy::permissions_set_readonly_false)]
|
||||
|
||||
Reference in New Issue
Block a user