Skip to content

Commit 3252082

Browse files
committed
Fix test on Windows hosts
FlushFileBuffers requires that a file be opened for writing
1 parent 7ba8bbc commit 3252082

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/run-pass/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ fn test_file_sync() {
188188
let path = prepare_with_content("miri_test_fs_sync.txt", bytes);
189189

190190
// Test that we can call sync_data and sync_all (can't readily test effects of this operation)
191-
let file = File::open(&path).unwrap();
191+
let file = OpenOptions::new().write(true).open(&path).unwrap();
192192
file.sync_data().unwrap();
193193
file.sync_all().unwrap();
194194

0 commit comments

Comments
 (0)