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.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();