aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_vfs/tests
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-26 12:42:14 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-26 12:42:14 +0000
commit05d0c493c9a94bb6cd4db816fa3bd88d8c389125 (patch)
tree6635a8619836d0c0b262ec095f50bc9668f24436 /crates/ra_vfs/tests
parent2acaa92c93bcd54d97221d0cede8780ff817476e (diff)
parent07a4b9f1a0c36c6bff4b0dbaaeaa93baea8b1f0e (diff)
Merge #672
672: dont overwrite memfies r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_vfs/tests')
-rw-r--r--crates/ra_vfs/tests/vfs.rs12
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();