aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/tests
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/tests')
-rw-r--r--crates/ra_analysis/tests/tests.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/ra_analysis/tests/tests.rs b/crates/ra_analysis/tests/tests.rs
index 7ae3d0eeb..52fae71ae 100644
--- a/crates/ra_analysis/tests/tests.rs
+++ b/crates/ra_analysis/tests/tests.rs
@@ -264,3 +264,17 @@ fn test_find_all_refs_for_param_inside() {
264 let refs = get_all_refs(code); 264 let refs = get_all_refs(code);
265 assert_eq!(refs.len(), 2); 265 assert_eq!(refs.len(), 2);
266} 266}
267
268#[test]
269fn test_complete_crate_path() {
270 let snap = analysis(&[
271 ("/lib.rs", "mod foo; struct Spam;"),
272 ("/foo.rs", "use crate::Sp"),
273 ]);
274 let completions = snap.completions(FileId(2), 13.into()).unwrap().unwrap();
275 assert_eq_dbg(
276 r#"[CompletionItem { label: "foo", lookup: None, snippet: None },
277 CompletionItem { label: "Spam", lookup: None, snippet: None }]"#,
278 &completions,
279 );
280}