From d34e725f09994af145884464942dd205bfc7717e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 30 Jun 2020 12:14:16 +0200 Subject: Better factoring --- crates/ra_hir_ty/src/tests.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'crates/ra_hir_ty/src/tests.rs') 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::{ SyntaxNode, }; use stdx::format_to; -use test_utils::extract_annotations; use crate::{ db::HirDatabase, display::HirDisplay, infer::TypeMismatch, test_db::TestDB, InferenceResult, Ty, @@ -49,9 +48,7 @@ fn check_types_source_code(ra_fixture: &str) { fn check_types_impl(ra_fixture: &str, display_source: bool) { let db = TestDB::with_files(ra_fixture); let mut checked_one = false; - for file_id in db.all_files() { - let text = db.parse(file_id).syntax_node().to_string(); - let annotations = extract_annotations(&text); + for (file_id, annotations) in db.extract_annotations() { for (range, expected) in annotations { let ty = type_at_range(&db, FileRange { file_id, range }); let actual = if display_source { -- cgit v1.2.3