Description
The Windows-specific code block in the readonly file test is currently empty, which means the test doesn't properly validate readonly file behavior on Windows platforms.
Location
- File:
tests/file_io_error_handling_test.rs
- Lines: 124-126
- Test:
test_write_to_readonly_file_error
Problem
The current implementation has an empty #[cfg(windows)] block, so the readonly file test only works on Unix systems. Windows requires different API calls to set file attributes as read-only.
Expected Implementation
The Windows branch should:
- Create and write initial content to the test file
- Set the FILE_ATTRIBUTE_READONLY flag using Windows API (SetFileAttributesW or helper crate)
- Run the same readonly behavior assertions as the Unix path
- Clear the read-only attribute before cleanup to ensure successful file deletion
References
Requested by
@logbie
Description
The Windows-specific code block in the readonly file test is currently empty, which means the test doesn't properly validate readonly file behavior on Windows platforms.
Location
tests/file_io_error_handling_test.rstest_write_to_readonly_file_errorProblem
The current implementation has an empty
#[cfg(windows)]block, so the readonly file test only works on Unix systems. Windows requires different API calls to set file attributes as read-only.Expected Implementation
The Windows branch should:
References
Requested by
@logbie