From 45232dfa689bafadf98b92ef30fd32ea9a5e9e7a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 21 Dec 2018 18:13:21 +0300 Subject: organize completion tests better --- crates/ra_analysis/tests/tests.rs | 60 --------------------------------------- 1 file changed, 60 deletions(-) (limited to 'crates/ra_analysis/tests') diff --git a/crates/ra_analysis/tests/tests.rs b/crates/ra_analysis/tests/tests.rs index 67738da48..938ca797a 100644 --- a/crates/ra_analysis/tests/tests.rs +++ b/crates/ra_analysis/tests/tests.rs @@ -452,63 +452,3 @@ fn test_find_all_refs_for_fn_param() { let refs = get_all_refs(code); assert_eq!(refs.len(), 2); } - -#[test] -fn test_complete_crate_path() { - let (analysis, position) = analysis_and_position( - " - //- /lib.rs - mod foo; - struct Spam; - //- /foo.rs - use crate::Sp<|> - ", - ); - let completions = analysis.completions(position).unwrap().unwrap(); - assert_eq_dbg( - r#"[CompletionItem { label: "Spam", lookup: None, snippet: None }, - CompletionItem { label: "foo", lookup: None, snippet: None }]"#, - &completions, - ); -} - -#[test] -fn test_complete_crate_path_with_braces() { - let (analysis, position) = analysis_and_position( - " - //- /lib.rs - mod foo; - struct Spam; - //- /foo.rs - use crate::{Sp<|>}; - ", - ); - let completions = analysis.completions(position).unwrap().unwrap(); - assert_eq_dbg( - r#"[CompletionItem { label: "Spam", lookup: None, snippet: None }, - CompletionItem { label: "foo", lookup: None, snippet: None }]"#, - &completions, - ); -} - -#[test] -fn test_complete_crate_path_in_nested_tree() { - let (analysis, position) = analysis_and_position( - " - //- /lib.rs - mod foo; - pub mod bar { - pub mod baz { - pub struct Spam; - } - } - //- /foo.rs - use crate::{bar::{baz::Sp<|>}}; - ", - ); - let completions = analysis.completions(position).unwrap().unwrap(); - assert_eq_dbg( - r#"[CompletionItem { label: "Spam", lookup: None, snippet: None }]"#, - &completions, - ); -} -- cgit v1.2.3