From dda916bc4d51383fcf84f736bd12c7a77c445fb0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 11 Jan 2019 18:17:20 +0300 Subject: fix tests --- crates/ra_ide_api/tests/test/main.rs | 40 ++---------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) (limited to 'crates/ra_ide_api/tests') diff --git a/crates/ra_ide_api/tests/test/main.rs b/crates/ra_ide_api/tests/test/main.rs index d1dc07e5b..7dc1dba73 100644 --- a/crates/ra_ide_api/tests/test/main.rs +++ b/crates/ra_ide_api/tests/test/main.rs @@ -4,7 +4,7 @@ use ra_syntax::TextRange; use test_utils::{assert_eq_dbg, assert_eq_text}; use ra_ide_api::{ - mock_analysis::{analysis_and_position, single_file, single_file_with_position, MockAnalysis}, + mock_analysis::{single_file, single_file_with_position, MockAnalysis}, AnalysisChange, CrateGraph, FileId, Query }; @@ -34,42 +34,6 @@ fn test_unresolved_module_diagnostic_no_diag_for_inline_mode() { assert_eq_dbg(r#"[]"#, &diagnostics); } -#[test] -fn test_resolve_parent_module() { - let (analysis, pos) = analysis_and_position( - " - //- /lib.rs - mod foo; - //- /foo.rs - <|>// empty - ", - ); - let symbols = analysis.parent_module(pos).unwrap(); - assert_eq_dbg( - r#"[NavigationTarget { file_id: FileId(1), name: "foo", kind: MODULE, range: [4; 7), ptr: None }]"#, - &symbols, - ); -} - -#[test] -fn test_resolve_parent_module_for_inline() { - let (analysis, pos) = analysis_and_position( - " - //- /lib.rs - mod foo { - mod bar { - mod baz { <|> } - } - } - ", - ); - let symbols = analysis.parent_module(pos).unwrap(); - assert_eq_dbg( - r#"[NavigationTarget { file_id: FileId(1), name: "baz", kind: MODULE, range: [36; 39), ptr: None }]"#, - &symbols, - ); -} - #[test] fn test_resolve_crate_root() { let mock = MockAnalysis::with_files( @@ -245,5 +209,5 @@ pub trait HirDatabase: SyntaxDatabase {} let mut symbols = analysis.symbol_search(Query::new("Hir".into())).unwrap(); let s = symbols.pop().unwrap(); assert_eq!(s.name(), "HirDatabase"); - assert_eq!(s.range(), TextRange::from_to(33.into(), 44.into())); + assert_eq!(s.full_range(), TextRange::from_to(33.into(), 44.into())); } -- cgit v1.2.3