aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils/src/fixture.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/test_utils/src/fixture.rs')
-rw-r--r--crates/test_utils/src/fixture.rs4
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};
8pub struct Fixture { 8pub 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,