From e9cb818c2683e06153f013c3b8d03f7f2719eb02 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 24 Jun 2020 11:05:47 +0200 Subject: Use fixtures more --- crates/ra_ide/src/syntax_highlighting/tests.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'crates/ra_ide/src/syntax_highlighting') 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() { fn test_ranges() { let (analysis, file_id) = single_file( r#" - #[derive(Clone, Debug)] - struct Foo { - pub x: i32, - pub y: i32, - }"#, +#[derive(Clone, Debug)] +struct Foo { + pub x: i32, + pub y: i32, +} +"#, ); // The "x" let highlights = &analysis - .highlight_range(FileRange { file_id, range: TextRange::at(82.into(), 1.into()) }) + .highlight_range(FileRange { file_id, range: TextRange::at(45.into(), 1.into()) }) .unwrap(); assert_eq!(&highlights[0].highlight.to_string(), "field.declaration"); -- cgit v1.2.3