aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils
diff options
context:
space:
mode:
Diffstat (limited to 'crates/test_utils')
-rw-r--r--crates/test_utils/src/fixture.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/crates/test_utils/src/fixture.rs b/crates/test_utils/src/fixture.rs
index e3f57f3b2..6bc824e94 100644
--- a/crates/test_utils/src/fixture.rs
+++ b/crates/test_utils/src/fixture.rs
@@ -14,6 +14,7 @@ pub struct Fixture {
14 pub cfg_key_values: Vec<(String, String)>, 14 pub cfg_key_values: Vec<(String, String)>,
15 pub edition: Option<String>, 15 pub edition: Option<String>,
16 pub env: FxHashMap<String, String>, 16 pub env: FxHashMap<String, String>,
17 pub introduce_new_source_root: bool,
17} 18}
18 19
19impl Fixture { 20impl Fixture {
@@ -70,6 +71,7 @@ impl Fixture {
70 let mut cfg_atoms = Vec::new(); 71 let mut cfg_atoms = Vec::new();
71 let mut cfg_key_values = Vec::new(); 72 let mut cfg_key_values = Vec::new();
72 let mut env = FxHashMap::default(); 73 let mut env = FxHashMap::default();
74 let mut introduce_new_source_root = false;
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 {
@@ -91,11 +93,22 @@ impl Fixture {
91 } 93 }
92 } 94 }
93 } 95 }
96 "new_source_root" => introduce_new_source_root = true,
94 _ => panic!("bad component: {:?}", component), 97 _ => panic!("bad component: {:?}", component),
95 } 98 }
96 } 99 }
97 100
98 Fixture { path, text: String::new(), krate, deps, cfg_atoms, cfg_key_values, edition, env } 101 Fixture {
102 path,
103 text: String::new(),
104 krate,
105 deps,
106 cfg_atoms,
107 cfg_key_values,
108 edition,
109 env,
110 introduce_new_source_root,
111 }
99 } 112 }
100} 113}
101 114