aboutsummaryrefslogtreecommitdiff
path: root/crates/base_db
diff options
context:
space:
mode:
authorJames Leitch <[email protected]>2020-11-02 00:20:55 +0000
committerJames Leitch <[email protected]>2020-11-02 00:20:55 +0000
commitd2d7a4403cad6913a1944cbe4aaedc6c8b936382 (patch)
treef7cf34e7e6bd2a9cc37cae3e0db5050529b9a27a /crates/base_db
parentbf84e4958ee31c59e5b78f60059d69a73ef659bb (diff)
Test Fixture ExplicitRoot + ModuleResolutionRelativePathOutsideRoot.
Diffstat (limited to 'crates/base_db')
-rw-r--r--crates/base_db/src/fixture.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/base_db/src/fixture.rs b/crates/base_db/src/fixture.rs
index 66e6443cb..3c6c516b2 100644
--- a/crates/base_db/src/fixture.rs
+++ b/crates/base_db/src/fixture.rs
@@ -150,6 +150,8 @@ impl ChangeFixture {
150 entry.text.clone() 150 entry.text.clone()
151 }; 151 };
152 152
153 let explicit_root = entry.explicit_root;
154
153 let meta = FileMeta::from(entry); 155 let meta = FileMeta::from(entry);
154 assert!(meta.path.starts_with(&source_root_prefix)); 156 assert!(meta.path.starts_with(&source_root_prefix));
155 157
@@ -169,7 +171,7 @@ impl ChangeFixture {
169 let dep = CrateName::normalize_dashes(&dep); 171 let dep = CrateName::normalize_dashes(&dep);
170 crate_deps.push((crate_name.clone(), dep)) 172 crate_deps.push((crate_name.clone(), dep))
171 } 173 }
172 } else if meta.path == "/main.rs" || meta.path == "/lib.rs" { 174 } else if meta.path == "/main.rs" || meta.path == "/lib.rs" || explicit_root {
173 assert!(default_crate_root.is_none()); 175 assert!(default_crate_root.is_none());
174 default_crate_root = Some(file_id); 176 default_crate_root = Some(file_id);
175 default_cfg = meta.cfg; 177 default_cfg = meta.cfg;