diff options
author | Aleksey Kladov <[email protected]> | 2020-10-02 16:34:31 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-10-02 16:49:44 +0100 |
commit | b06259673f9b535a63c0cabf4eeb935ff73d86d0 (patch) | |
tree | a1d9c304711806c393163547fe6da69289aa9f16 /crates/ide/src/syntax_highlighting | |
parent | 09348b247465864c6462a39055803bcbb0156cfe (diff) |
rename mock_analysis -> fixture
Diffstat (limited to 'crates/ide/src/syntax_highlighting')
-rw-r--r-- | crates/ide/src/syntax_highlighting/tests.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index eaa4e163e..694c4b7fa 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs | |||
@@ -3,7 +3,7 @@ use std::fs; | |||
3 | use expect_test::{expect_file, ExpectFile}; | 3 | use expect_test::{expect_file, ExpectFile}; |
4 | use test_utils::project_dir; | 4 | use test_utils::project_dir; |
5 | 5 | ||
6 | use crate::{mock_analysis::single_file, FileRange, TextRange}; | 6 | use crate::{fixture, FileRange, TextRange}; |
7 | 7 | ||
8 | #[test] | 8 | #[test] |
9 | fn test_highlighting() { | 9 | fn test_highlighting() { |
@@ -178,7 +178,7 @@ fn accidentally_quadratic() { | |||
178 | let file = project_dir().join("crates/syntax/test_data/accidentally_quadratic"); | 178 | let file = project_dir().join("crates/syntax/test_data/accidentally_quadratic"); |
179 | let src = fs::read_to_string(file).unwrap(); | 179 | let src = fs::read_to_string(file).unwrap(); |
180 | 180 | ||
181 | let (analysis, file_id) = single_file(&src); | 181 | let (analysis, file_id) = fixture::file(&src); |
182 | 182 | ||
183 | // let t = std::time::Instant::now(); | 183 | // let t = std::time::Instant::now(); |
184 | let _ = analysis.highlight(file_id).unwrap(); | 184 | let _ = analysis.highlight(file_id).unwrap(); |
@@ -187,7 +187,7 @@ fn accidentally_quadratic() { | |||
187 | 187 | ||
188 | #[test] | 188 | #[test] |
189 | fn test_ranges() { | 189 | fn test_ranges() { |
190 | let (analysis, file_id) = single_file( | 190 | let (analysis, file_id) = fixture::file( |
191 | r#" | 191 | r#" |
192 | #[derive(Clone, Debug)] | 192 | #[derive(Clone, Debug)] |
193 | struct Foo { | 193 | struct Foo { |
@@ -228,7 +228,7 @@ fn main() { | |||
228 | 228 | ||
229 | #[test] | 229 | #[test] |
230 | fn ranges_sorted() { | 230 | fn ranges_sorted() { |
231 | let (analysis, file_id) = single_file( | 231 | let (analysis, file_id) = fixture::file( |
232 | r#" | 232 | r#" |
233 | #[foo(bar = "bar")] | 233 | #[foo(bar = "bar")] |
234 | macro_rules! test {} | 234 | macro_rules! test {} |
@@ -479,7 +479,7 @@ fn test_extern_crate() { | |||
479 | /// result as HTML, and compares it with the HTML file given as `snapshot`. | 479 | /// result as HTML, and compares it with the HTML file given as `snapshot`. |
480 | /// Note that the `snapshot` file is overwritten by the rendered HTML. | 480 | /// Note that the `snapshot` file is overwritten by the rendered HTML. |
481 | fn check_highlighting(ra_fixture: &str, expect: ExpectFile, rainbow: bool) { | 481 | fn check_highlighting(ra_fixture: &str, expect: ExpectFile, rainbow: bool) { |
482 | let (analysis, file_id) = single_file(ra_fixture); | 482 | let (analysis, file_id) = fixture::file(ra_fixture); |
483 | let actual_html = &analysis.highlight_as_html(file_id, rainbow).unwrap(); | 483 | let actual_html = &analysis.highlight_as_html(file_id, rainbow).unwrap(); |
484 | expect.assert_eq(actual_html) | 484 | expect.assert_eq(actual_html) |
485 | } | 485 | } |