830: Fix test_vfs_works failing on Windows due to extra Write events r=pnkfelix a=vipentti

On Windows `notify` generates extra `Write` events for folders, which caused
`process_tasks` to not handle all tasks generated on Windows.

This fixes #827

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
This commit is contained in:
bors[bot] 2019-02-14 22:00:11 +00:00
commit 17370463e2

View File

@ -118,7 +118,9 @@ fn test_vfs_works() -> std::io::Result<()> {
fs::rename(&dir.path().join("a/sub1/sub2/new.rs"), &dir.path().join("a/sub1/sub2/new1.rs"))
.unwrap();
process_tasks(&mut vfs, 2);
// NOTE: Windows generates extra `Write` events when renaming?
// meaning we have extra tasks to process
process_tasks(&mut vfs, if cfg!(windows) { 4 } else { 2 });
assert_match!(
vfs.commit_changes().as_slice(),
[VfsChange::RemoveFile { path: removed_path, .. }, VfsChange::AddFile { text, path: added_path, .. }],