aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-10-02 16:34:31 +0100
committerAleksey Kladov <[email protected]>2020-10-02 16:49:44 +0100
commitb06259673f9b535a63c0cabf4eeb935ff73d86d0 (patch)
treea1d9c304711806c393163547fe6da69289aa9f16 /crates/ide/src/syntax_highlighting
parent09348b247465864c6462a39055803bcbb0156cfe (diff)
rename mock_analysis -> fixture
Diffstat (limited to 'crates/ide/src/syntax_highlighting')
-rw-r--r--crates/ide/src/syntax_highlighting/tests.rs10
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;
3use expect_test::{expect_file, ExpectFile}; 3use expect_test::{expect_file, ExpectFile};
4use test_utils::project_dir; 4use test_utils::project_dir;
5 5
6use crate::{mock_analysis::single_file, FileRange, TextRange}; 6use crate::{fixture, FileRange, TextRange};
7 7
8#[test] 8#[test]
9fn test_highlighting() { 9fn 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]
189fn test_ranges() { 189fn 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)]
193struct Foo { 193struct Foo {
@@ -228,7 +228,7 @@ fn main() {
228 228
229#[test] 229#[test]
230fn ranges_sorted() { 230fn 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")]
234macro_rules! test {} 234macro_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.
481fn check_highlighting(ra_fixture: &str, expect: ExpectFile, rainbow: bool) { 481fn 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}