diff options
author | James Leitch <[email protected]> | 2020-11-02 00:20:55 +0000 |
---|---|---|
committer | James Leitch <[email protected]> | 2020-11-02 00:20:55 +0000 |
commit | d2d7a4403cad6913a1944cbe4aaedc6c8b936382 (patch) | |
tree | f7cf34e7e6bd2a9cc37cae3e0db5050529b9a27a /crates/test_utils/src/fixture.rs | |
parent | bf84e4958ee31c59e5b78f60059d69a73ef659bb (diff) |
Test Fixture ExplicitRoot + ModuleResolutionRelativePathOutsideRoot.
Diffstat (limited to 'crates/test_utils/src/fixture.rs')
-rw-r--r-- | crates/test_utils/src/fixture.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/test_utils/src/fixture.rs b/crates/test_utils/src/fixture.rs index e40b61a94..806ab06c1 100644 --- a/crates/test_utils/src/fixture.rs +++ b/crates/test_utils/src/fixture.rs | |||
@@ -8,6 +8,7 @@ use stdx::{lines_with_ends, split_once, trim_indent}; | |||
8 | pub struct Fixture { | 8 | pub struct Fixture { |
9 | pub path: String, | 9 | pub path: String, |
10 | pub text: String, | 10 | pub text: String, |
11 | pub explicit_root: bool, | ||
11 | pub krate: Option<String>, | 12 | pub krate: Option<String>, |
12 | pub deps: Vec<String>, | 13 | pub deps: Vec<String>, |
13 | pub cfg_atoms: Vec<String>, | 14 | pub cfg_atoms: Vec<String>, |
@@ -64,6 +65,7 @@ impl Fixture { | |||
64 | let path = components[0].to_string(); | 65 | let path = components[0].to_string(); |
65 | assert!(path.starts_with('/')); | 66 | assert!(path.starts_with('/')); |
66 | 67 | ||
68 | let mut explicit_root = false; | ||
67 | let mut krate = None; | 69 | let mut krate = None; |
68 | let mut deps = Vec::new(); | 70 | let mut deps = Vec::new(); |
69 | let mut edition = None; | 71 | let mut edition = None; |
@@ -73,6 +75,7 @@ impl Fixture { | |||
73 | for component in components[1..].iter() { | 75 | for component in components[1..].iter() { |
74 | let (key, value) = split_once(component, ':').unwrap(); | 76 | let (key, value) = split_once(component, ':').unwrap(); |
75 | match key { | 77 | match key { |
78 | "root" => explicit_root = true, | ||
76 | "crate" => krate = Some(value.to_string()), | 79 | "crate" => krate = Some(value.to_string()), |
77 | "deps" => deps = value.split(',').map(|it| it.to_string()).collect(), | 80 | "deps" => deps = value.split(',').map(|it| it.to_string()).collect(), |
78 | "edition" => edition = Some(value.to_string()), | 81 | "edition" => edition = Some(value.to_string()), |
@@ -98,6 +101,7 @@ impl Fixture { | |||
98 | Fixture { | 101 | Fixture { |
99 | path, | 102 | path, |
100 | text: String::new(), | 103 | text: String::new(), |
104 | explicit_root: explicit_root, | ||
101 | krate: krate, | 105 | krate: krate, |
102 | deps, | 106 | deps, |
103 | cfg_atoms, | 107 | cfg_atoms, |