diff options
Diffstat (limited to 'crates/ra_vfs/tests/vfs.rs')
-rw-r--r-- | crates/ra_vfs/tests/vfs.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ra_vfs/tests/vfs.rs b/crates/ra_vfs/tests/vfs.rs index 357e1c775..545e1dbdd 100644 --- a/crates/ra_vfs/tests/vfs.rs +++ b/crates/ra_vfs/tests/vfs.rs | |||
@@ -165,6 +165,18 @@ fn test_vfs_works() -> std::io::Result<()> { | |||
165 | assert_eq!(path, "sub1/sub2/new1.rs") | 165 | assert_eq!(path, "sub1/sub2/new1.rs") |
166 | ); | 166 | ); |
167 | 167 | ||
168 | { | ||
169 | vfs.add_file_overlay(&dir.path().join("a/memfile.rs"), "memfile".to_string()); | ||
170 | assert_match!( | ||
171 | vfs.commit_changes().as_slice(), | ||
172 | [VfsChange::AddFile { text, .. }], | ||
173 | assert_eq!(text.as_str(), "memfile") | ||
174 | ); | ||
175 | fs::write(&dir.path().join("a/memfile.rs"), "ignore me").unwrap(); | ||
176 | process_tasks(&mut vfs, 1); | ||
177 | assert_match!(vfs.commit_changes().as_slice(), []); | ||
178 | } | ||
179 | |||
168 | // should be ignored | 180 | // should be ignored |
169 | fs::create_dir_all(dir.path().join("a/target")).unwrap(); | 181 | fs::create_dir_all(dir.path().join("a/target")).unwrap(); |
170 | fs::write(&dir.path().join("a/target/new.rs"), "ignore me").unwrap(); | 182 | fs::write(&dir.path().join("a/target/new.rs"), "ignore me").unwrap(); |