diff options
author | Aleksey Kladov <[email protected]> | 2019-01-26 12:41:52 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-26 12:41:52 +0000 |
commit | 07a4b9f1a0c36c6bff4b0dbaaeaa93baea8b1f0e (patch) | |
tree | 6635a8619836d0c0b262ec095f50bc9668f24436 /crates/ra_vfs/tests/vfs.rs | |
parent | 2acaa92c93bcd54d97221d0cede8780ff817476e (diff) |
dont overwrite memfies
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(); |