From 59dd30402b7a1924a0f49d1c902e799654a54f5a Mon Sep 17 00:00:00 2001 From: Phil Ellison Date: Sat, 17 Aug 2019 07:12:50 +0100 Subject: Specify cursor position in ok-wrapping tests, and switch to using analysis_and_position function --- crates/ra_ide_api/src/mock_analysis.rs | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'crates/ra_ide_api/src/mock_analysis.rs') diff --git a/crates/ra_ide_api/src/mock_analysis.rs b/crates/ra_ide_api/src/mock_analysis.rs index 0eaf5d15a..132f6f875 100644 --- a/crates/ra_ide_api/src/mock_analysis.rs +++ b/crates/ra_ide_api/src/mock_analysis.rs @@ -80,15 +80,6 @@ impl MockAnalysis { .expect("no file in this mock"); FileId(idx as u32 + 1) } - pub fn id_and_contents_of(&self, path: &str) -> (FileId, String) { - let (idx, contents) = self - .files - .iter() - .enumerate() - .find(|(_, (p, _text))| path == p) - .expect("no file in this mock"); - (FileId(idx as u32 + 1), contents.1.to_string()) - } pub fn analysis_host(self) -> AnalysisHost { let mut host = AnalysisHost::default(); let source_root = SourceRootId(0); @@ -133,14 +124,6 @@ pub fn single_file(code: &str) -> (Analysis, FileId) { (mock.analysis(), file_id) } -/// Creates analysis from a fixture with multiple files -/// and returns the file id and contents of the target file. -pub fn fixture_with_target_file(fixture: &str, target_file: &str) -> (Analysis, FileId, String) { - let mock = MockAnalysis::with_files(fixture); - let (target_file_id, target_file_contents) = mock.id_and_contents_of(target_file); - (mock.analysis(), target_file_id, target_file_contents) -} - /// Creates analysis for a single file, returns position marked with <|>. pub fn single_file_with_position(code: &str) -> (Analysis, FilePosition) { let mut mock = MockAnalysis::new(); -- cgit v1.2.3