diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-24 10:34:25 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-24 10:34:25 +0100 |
commit | 7c28d060b5a5c4e7004282aa6827c3023c5b03c8 (patch) | |
tree | 0ed66d422a10a9f192a039565ac70b85dbdf80f8 /crates/ra_ide/src/syntax_highlighting/tests.rs | |
parent | 15c71f881607db5ddfd759785f62e4ae44aaf301 (diff) | |
parent | c749fe223bf5a41709a4bc91d0f56dafc4201658 (diff) |
Merge #5021
5021: Reduce code dupication around fixtures r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting/tests.rs')
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting/tests.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ra_ide/src/syntax_highlighting/tests.rs index b1f48f03b..c8943816f 100644 --- a/crates/ra_ide/src/syntax_highlighting/tests.rs +++ b/crates/ra_ide/src/syntax_highlighting/tests.rs | |||
@@ -140,16 +140,17 @@ fn accidentally_quadratic() { | |||
140 | fn test_ranges() { | 140 | fn test_ranges() { |
141 | let (analysis, file_id) = single_file( | 141 | let (analysis, file_id) = single_file( |
142 | r#" | 142 | r#" |
143 | #[derive(Clone, Debug)] | 143 | #[derive(Clone, Debug)] |
144 | struct Foo { | 144 | struct Foo { |
145 | pub x: i32, | 145 | pub x: i32, |
146 | pub y: i32, | 146 | pub y: i32, |
147 | }"#, | 147 | } |
148 | "#, | ||
148 | ); | 149 | ); |
149 | 150 | ||
150 | // The "x" | 151 | // The "x" |
151 | let highlights = &analysis | 152 | let highlights = &analysis |
152 | .highlight_range(FileRange { file_id, range: TextRange::at(82.into(), 1.into()) }) | 153 | .highlight_range(FileRange { file_id, range: TextRange::at(45.into(), 1.into()) }) |
153 | .unwrap(); | 154 | .unwrap(); |
154 | 155 | ||
155 | assert_eq!(&highlights[0].highlight.to_string(), "field.declaration"); | 156 | assert_eq!(&highlights[0].highlight.to_string(), "field.declaration"); |