Skip to content

Fix(lib/fs/tests): Disable rename POSIX semantics FS tests under Windows 7 #137388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions library/std/src/fs/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1914,8 +1914,11 @@ fn test_hidden_file_truncation() {
assert_eq!(metadata.len(), 0);
}

// See https://github.com/rust-lang/rust/pull/131072 for more details about why
// these two tests are disabled under Windows 7 here.
#[cfg(windows)]
#[test]
#[cfg_attr(target_vendor = "win7", ignore = "Unsupported under Windows 7.")]
fn test_rename_file_over_open_file() {
// Make sure that std::fs::rename works if the target file is already opened with FILE_SHARE_DELETE. See #123985.
let tmpdir = tmpdir();
Expand All @@ -1940,6 +1943,7 @@ fn test_rename_file_over_open_file() {

#[test]
#[cfg(windows)]
#[cfg_attr(target_vendor = "win7", ignore = "Unsupported under Windows 7.")]
fn test_rename_directory_to_non_empty_directory() {
// Renaming a directory over a non-empty existing directory should fail on Windows.
let tmpdir: TempDir = tmpdir();
Expand Down
Loading