diff options
author | Ville Penttinen <[email protected]> | 2019-02-14 16:30:21 +0000 |
---|---|---|
committer | Ville Penttinen <[email protected]> | 2019-02-14 16:30:21 +0000 |
commit | 50e49e0bc0adf5a2d1c5e3eb4207633388f3e96d (patch) | |
tree | d9d229f980ab0a54d70ceee2bd89c48deaef950b | |
parent | b85c189500a47f3c5f7690250611b06e08616c9a (diff) |
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
-rw-r--r-- | crates/ra_vfs/tests/vfs.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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<()> { | |||
118 | 118 | ||
119 | fs::rename(&dir.path().join("a/sub1/sub2/new.rs"), &dir.path().join("a/sub1/sub2/new1.rs")) | 119 | fs::rename(&dir.path().join("a/sub1/sub2/new.rs"), &dir.path().join("a/sub1/sub2/new1.rs")) |
120 | .unwrap(); | 120 | .unwrap(); |
121 | process_tasks(&mut vfs, 2); | 121 | // NOTE: Windows generates extra `Write` events when renaming? |
122 | // meaning we have extra tasks to process | ||
123 | process_tasks(&mut vfs, if cfg!(windows) { 4 } else { 2 }); | ||
122 | assert_match!( | 124 | assert_match!( |
123 | vfs.commit_changes().as_slice(), | 125 | vfs.commit_changes().as_slice(), |
124 | [VfsChange::RemoveFile { path: removed_path, .. }, VfsChange::AddFile { text, path: added_path, .. }], | 126 | [VfsChange::RemoveFile { path: removed_path, .. }, VfsChange::AddFile { text, path: added_path, .. }], |