aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/syntax_highlighting/tests.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-24 10:34:25 +0100
committerGitHub <[email protected]>2020-06-24 10:34:25 +0100
commit7c28d060b5a5c4e7004282aa6827c3023c5b03c8 (patch)
tree0ed66d422a10a9f192a039565ac70b85dbdf80f8 /crates/ra_ide/src/syntax_highlighting/tests.rs
parent15c71f881607db5ddfd759785f62e4ae44aaf301 (diff)
parentc749fe223bf5a41709a4bc91d0f56dafc4201658 (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.rs13
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() {
140fn test_ranges() { 140fn 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 { 144struct 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");