diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-24 10:52:24 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-24 10:52:24 +0100 |
commit | 5d84e27ba961e03c3f394b9a6ef2a035dcc183be (patch) | |
tree | 0d3e1feeb92d40a080653f1e79233f18d161a8ef /crates/ra_ide/src/syntax_highlighting/tests.rs | |
parent | 7c28d060b5a5c4e7004282aa6827c3023c5b03c8 (diff) | |
parent | 04fe512f0d3567727cfb9ccab166c5344716711a (diff) |
Merge #5022
5022: Simplify 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 | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ra_ide/src/syntax_highlighting/tests.rs index c8943816f..b7fad9719 100644 --- a/crates/ra_ide/src/syntax_highlighting/tests.rs +++ b/crates/ra_ide/src/syntax_highlighting/tests.rs | |||
@@ -2,10 +2,7 @@ use std::fs; | |||
2 | 2 | ||
3 | use test_utils::{assert_eq_text, project_dir, read_text}; | 3 | use test_utils::{assert_eq_text, project_dir, read_text}; |
4 | 4 | ||
5 | use crate::{ | 5 | use crate::{mock_analysis::single_file, FileRange, TextRange}; |
6 | mock_analysis::{single_file, MockAnalysis}, | ||
7 | FileRange, TextRange, | ||
8 | }; | ||
9 | 6 | ||
10 | #[test] | 7 | #[test] |
11 | fn test_highlighting() { | 8 | fn test_highlighting() { |
@@ -127,12 +124,10 @@ fn accidentally_quadratic() { | |||
127 | let file = project_dir().join("crates/ra_syntax/test_data/accidentally_quadratic"); | 124 | let file = project_dir().join("crates/ra_syntax/test_data/accidentally_quadratic"); |
128 | let src = fs::read_to_string(file).unwrap(); | 125 | let src = fs::read_to_string(file).unwrap(); |
129 | 126 | ||
130 | let mut mock = MockAnalysis::new(); | 127 | let (analysis, file_id) = single_file(&src); |
131 | let file_id = mock.add_file("/main.rs", &src); | ||
132 | let host = mock.analysis_host(); | ||
133 | 128 | ||
134 | // let t = std::time::Instant::now(); | 129 | // let t = std::time::Instant::now(); |
135 | let _ = host.analysis().highlight(file_id).unwrap(); | 130 | let _ = analysis.highlight(file_id).unwrap(); |
136 | // eprintln!("elapsed: {:?}", t.elapsed()); | 131 | // eprintln!("elapsed: {:?}", t.elapsed()); |
137 | } | 132 | } |
138 | 133 | ||