From 50e49e0bc0adf5a2d1c5e3eb4207633388f3e96d Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Thu, 14 Feb 2019 18:30:21 +0200 Subject: Fix test_vfs_works failing on Windows due to extra Write events On Windows `notify` generates extra `Write` events for folders, which caused `process_tasks` to not handle all tasks generated on Windows. This fixes #827 --- crates/ra_vfs/tests/vfs.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/ra_vfs') diff --git a/crates/ra_vfs/tests/vfs.rs b/crates/ra_vfs/tests/vfs.rs index 649ef96c9..0ed59bb19 100644 --- a/crates/ra_vfs/tests/vfs.rs +++ b/crates/ra_vfs/tests/vfs.rs @@ -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, .. }], -- cgit v1.2.3