aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-06-23 19:38:36 +0100
committerAleksey Kladov <[email protected]>2020-06-23 19:38:36 +0100
commit295c8d4f7f9ce9d3dc67e8a988914d90424c1b7e (patch)
treea3fc00ca2a19fa1294cf93030ff0d4a8d80f647f /crates/test_utils
parenta34f9b7fb343114446be08c7867b699b2210710f (diff)
Complicate
Fixing test fallout unfortunately requires more work, we need to do it, but let's merge something at least!
Diffstat (limited to 'crates/test_utils')
-rw-r--r--crates/test_utils/src/fixture.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/test_utils/src/fixture.rs b/crates/test_utils/src/fixture.rs
index ba00607f2..9108e49d9 100644
--- a/crates/test_utils/src/fixture.rs
+++ b/crates/test_utils/src/fixture.rs
@@ -55,8 +55,7 @@ The offending line: {:?}"#,
55 let mut res: Vec<Fixture> = Vec::new(); 55 let mut res: Vec<Fixture> = Vec::new();
56 for line in lines.by_ref() { 56 for line in lines.by_ref() {
57 if line.starts_with("//-") { 57 if line.starts_with("//-") {
58 let meta = line["//-".len()..].trim().to_string(); 58 let meta = Fixture::parse_single(line);
59 let meta = Fixture::parse_single(&meta);
60 res.push(meta) 59 res.push(meta)
61 } else if let Some(entry) = res.last_mut() { 60 } else if let Some(entry) = res.last_mut() {
62 entry.text.push_str(line); 61 entry.text.push_str(line);
@@ -67,7 +66,9 @@ The offending line: {:?}"#,
67 } 66 }
68 67
69 //- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b env:OUTDIR=path/to,OTHER=foo 68 //- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b env:OUTDIR=path/to,OTHER=foo
70 fn parse_single(meta: &str) -> Fixture { 69 pub fn parse_single(meta: &str) -> Fixture {
70 assert!(meta.starts_with("//-"));
71 let meta = meta["//-".len()..].trim();
71 let components = meta.split_ascii_whitespace().collect::<Vec<_>>(); 72 let components = meta.split_ascii_whitespace().collect::<Vec<_>>();
72 73
73 let path = components[0].to_string(); 74 let path = components[0].to_string();