diff options
author | Aleksey Kladov <[email protected]> | 2020-06-23 23:30:34 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-06-23 23:30:34 +0100 |
commit | e5101ae150db5faa7ddf8393e375032ef371f5e5 (patch) | |
tree | 89f9a2cc1c4113222bbb3e1241e68c712c2a21fb /crates/test_utils | |
parent | 44cf263edf1c7e3b189ef5f1cfdf207dd28a0054 (diff) |
Centralize fixture parsing for assists
Diffstat (limited to 'crates/test_utils')
-rw-r--r-- | crates/test_utils/src/fixture.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/test_utils/src/fixture.rs b/crates/test_utils/src/fixture.rs index 8747fa4a5..7e93fbcd6 100644 --- a/crates/test_utils/src/fixture.rs +++ b/crates/test_utils/src/fixture.rs | |||
@@ -30,7 +30,9 @@ impl Fixture { | |||
30 | 30 | ||
31 | let mut res: Vec<Fixture> = Vec::new(); | 31 | let mut res: Vec<Fixture> = Vec::new(); |
32 | 32 | ||
33 | for (ix, line) in lines_with_ends(&fixture).enumerate() { | 33 | let default = if ra_fixture.contains("//-") { None } else { Some("//- /main.rs") }; |
34 | |||
35 | for (ix, line) in default.into_iter().chain(lines_with_ends(&fixture)).enumerate() { | ||
34 | if line.contains("//-") { | 36 | if line.contains("//-") { |
35 | assert!( | 37 | assert!( |
36 | line.starts_with("//-"), | 38 | line.starts_with("//-"), |