diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-30 12:30:51 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-30 12:30:51 +0100 |
commit | 6a73d544f4117b942b300afb8bda98216fc92356 (patch) | |
tree | 18b444a0d447465a7de75ec5a0153c90b8566a7f /crates/ra_hir_ty/src/tests.rs | |
parent | 5a0fb3caff745d20face2d7ab02fa4da63faef9c (diff) | |
parent | af7e300041b1af68e671446fe22d2b9e5d30f83d (diff) |
Merge #5137
5137: Make gotodef tests more data-driven r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/tests.rs')
-rw-r--r-- | crates/ra_hir_ty/src/tests.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs index 5424e6bb1..9084c3bed 100644 --- a/crates/ra_hir_ty/src/tests.rs +++ b/crates/ra_hir_ty/src/tests.rs | |||
@@ -28,7 +28,6 @@ use ra_syntax::{ | |||
28 | SyntaxNode, | 28 | SyntaxNode, |
29 | }; | 29 | }; |
30 | use stdx::format_to; | 30 | use stdx::format_to; |
31 | use test_utils::extract_annotations; | ||
32 | 31 | ||
33 | use crate::{ | 32 | use crate::{ |
34 | db::HirDatabase, display::HirDisplay, infer::TypeMismatch, test_db::TestDB, InferenceResult, Ty, | 33 | db::HirDatabase, display::HirDisplay, infer::TypeMismatch, test_db::TestDB, InferenceResult, Ty, |
@@ -49,9 +48,7 @@ fn check_types_source_code(ra_fixture: &str) { | |||
49 | fn check_types_impl(ra_fixture: &str, display_source: bool) { | 48 | fn check_types_impl(ra_fixture: &str, display_source: bool) { |
50 | let db = TestDB::with_files(ra_fixture); | 49 | let db = TestDB::with_files(ra_fixture); |
51 | let mut checked_one = false; | 50 | let mut checked_one = false; |
52 | for file_id in db.all_files() { | 51 | for (file_id, annotations) in db.extract_annotations() { |
53 | let text = db.parse(file_id).syntax_node().to_string(); | ||
54 | let annotations = extract_annotations(&text); | ||
55 | for (range, expected) in annotations { | 52 | for (range, expected) in annotations { |
56 | let ty = type_at_range(&db, FileRange { file_id, range }); | 53 | let ty = type_at_range(&db, FileRange { file_id, range }); |
57 | let actual = if display_source { | 54 | let actual = if display_source { |