From 75fafd6fcc010c71d770d19bea4b744b92c5267b Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 16 Mar 2021 15:28:02 +0100 Subject: Add new_source_root meta to test fixtures --- crates/test_utils/src/fixture.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'crates/test_utils/src') 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 { pub cfg_key_values: Vec<(String, String)>, pub edition: Option, pub env: FxHashMap, + pub introduce_new_source_root: bool, } impl Fixture { @@ -70,6 +71,7 @@ impl Fixture { let mut cfg_atoms = Vec::new(); let mut cfg_key_values = Vec::new(); let mut env = FxHashMap::default(); + let mut introduce_new_source_root = false; for component in components[1..].iter() { let (key, value) = split_once(component, ':').unwrap(); match key { @@ -91,11 +93,22 @@ impl Fixture { } } } + "new_source_root" => introduce_new_source_root = true, _ => panic!("bad component: {:?}", component), } } - Fixture { path, text: String::new(), krate, deps, cfg_atoms, cfg_key_values, edition, env } + Fixture { + path, + text: String::new(), + krate, + deps, + cfg_atoms, + cfg_key_values, + edition, + env, + introduce_new_source_root, + } } } -- cgit v1.2.3