diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-23 23:59:22 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-23 23:59:22 +0100 |
commit | 471d44e72c54882cff2e00c662ee74d8c7c94234 (patch) | |
tree | 841871b66bc008a18a5a1053f5a33415c3a54ad9 /crates/test_utils | |
parent | 44cf263edf1c7e3b189ef5f1cfdf207dd28a0054 (diff) | |
parent | d016cb486738c1ab2574a322924183fa8a870b06 (diff) |
Merge #5014
5014: Use only one code-path for parsing fixtures r=matklad a=matklad
This removes leading newlines everywhere, shifting all ranges in tests
by one
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
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("//-"), |