diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-14 22:00:11 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-14 22:00:11 +0000 |
commit | 17370463e2bc23f7a654f95f589cf6de767f9fb8 (patch) | |
tree | 804b010ce08019b3d019982364a9dc65794a8061 /crates/ra_vfs/tests | |
parent | f8d4cec342963575482169452c1e86a67c3d4c1b (diff) | |
parent | 50e49e0bc0adf5a2d1c5e3eb4207633388f3e96d (diff) |
Merge #830
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 <[email protected]>
Diffstat (limited to 'crates/ra_vfs/tests')
-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 c76e6ea26..b31e0f288 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, .. }], |