From a1940d8c75bee8c319e7e7f19607bdc4b01c28d4 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 13 Jun 2021 19:23:37 +0300 Subject: internal: check diagnostics in all files and not just the first one --- crates/ide/src/fixture.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'crates/ide/src/fixture.rs') diff --git a/crates/ide/src/fixture.rs b/crates/ide/src/fixture.rs index 6780af617..38e2e866b 100644 --- a/crates/ide/src/fixture.rs +++ b/crates/ide/src/fixture.rs @@ -1,6 +1,5 @@ //! Utilities for creating `Analysis` instances for tests. use ide_db::base_db::fixture::ChangeFixture; -use syntax::{TextRange, TextSize}; use test_utils::extract_annotations; use crate::{Analysis, AnalysisHost, FileId, FilePosition, FileRange}; @@ -63,15 +62,8 @@ pub(crate) fn annotations(ra_fixture: &str) -> (Analysis, FilePosition, Vec<(Fil pub(crate) fn nav_target_annotation(ra_fixture: &str) -> (Analysis, FilePosition, FileRange) { let (analysis, position, mut annotations) = annotations(ra_fixture); - let (mut expected, data) = annotations.pop().unwrap(); + let (expected, data) = annotations.pop().unwrap(); assert!(annotations.is_empty()); - match data.as_str() { - "" => (), - "file" => { - expected.range = - TextRange::up_to(TextSize::of(&*analysis.file_text(expected.file_id).unwrap())) - } - data => panic!("bad data: {}", data), - } + assert_eq!(data, ""); (analysis, position, expected) } -- cgit v1.2.3