diff options
author | Aleksey Kladov <[email protected]> | 2020-06-24 09:22:02 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-06-24 09:28:28 +0100 |
commit | 08e2149eab4495bd816a30b3caf586bef2cd9649 (patch) | |
tree | 26fec828b7cc8c64f80ba23c65cdd81ab3e7dc08 /crates/test_utils/src | |
parent | c544f9a137bd675fd6e9cc4c244ff4366ededb50 (diff) |
Simplify
Diffstat (limited to 'crates/test_utils/src')
-rw-r--r-- | crates/test_utils/src/fixture.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/test_utils/src/fixture.rs b/crates/test_utils/src/fixture.rs index 7e93fbcd6..fad8f7e2c 100644 --- a/crates/test_utils/src/fixture.rs +++ b/crates/test_utils/src/fixture.rs | |||
@@ -8,7 +8,7 @@ use stdx::{lines_with_ends, split_delim, trim_indent}; | |||
8 | pub struct Fixture { | 8 | pub struct Fixture { |
9 | pub path: String, | 9 | pub path: String, |
10 | pub text: String, | 10 | pub text: String, |
11 | pub crate_name: Option<String>, | 11 | pub krate: Option<String>, |
12 | pub deps: Vec<String>, | 12 | pub deps: Vec<String>, |
13 | pub cfg_atoms: Vec<String>, | 13 | pub cfg_atoms: Vec<String>, |
14 | pub cfg_key_values: Vec<(String, String)>, | 14 | pub cfg_key_values: Vec<(String, String)>, |
@@ -56,7 +56,7 @@ impl Fixture { | |||
56 | } | 56 | } |
57 | 57 | ||
58 | //- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b env:OUTDIR=path/to,OTHER=foo | 58 | //- /lib.rs crate:foo deps:bar,baz cfg:foo=a,bar=b env:OUTDIR=path/to,OTHER=foo |
59 | pub fn parse_meta_line(meta: &str) -> Fixture { | 59 | fn parse_meta_line(meta: &str) -> Fixture { |
60 | assert!(meta.starts_with("//-")); | 60 | assert!(meta.starts_with("//-")); |
61 | let meta = meta["//-".len()..].trim(); | 61 | let meta = meta["//-".len()..].trim(); |
62 | let components = meta.split_ascii_whitespace().collect::<Vec<_>>(); | 62 | let components = meta.split_ascii_whitespace().collect::<Vec<_>>(); |
@@ -98,7 +98,7 @@ impl Fixture { | |||
98 | Fixture { | 98 | Fixture { |
99 | path, | 99 | path, |
100 | text: String::new(), | 100 | text: String::new(), |
101 | crate_name: krate, | 101 | krate: krate, |
102 | deps, | 102 | deps, |
103 | cfg_atoms, | 103 | cfg_atoms, |
104 | cfg_key_values, | 104 | cfg_key_values, |
@@ -136,7 +136,7 @@ fn parse_fixture_gets_full_meta() { | |||
136 | let meta = &parsed[0]; | 136 | let meta = &parsed[0]; |
137 | assert_eq!("mod m;\n", meta.text); | 137 | assert_eq!("mod m;\n", meta.text); |
138 | 138 | ||
139 | assert_eq!("foo", meta.crate_name.as_ref().unwrap()); | 139 | assert_eq!("foo", meta.krate.as_ref().unwrap()); |
140 | assert_eq!("/lib.rs", meta.path); | 140 | assert_eq!("/lib.rs", meta.path); |
141 | assert_eq!(2, meta.env.len()); | 141 | assert_eq!(2, meta.env.len()); |
142 | } | 142 | } |