aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/tests
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-10-24 17:16:32 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-10-24 17:16:32 +0100
commit072260ffe89b278cd47d972f27c350a125bc75a5 (patch)
tree08cccd64582510ce2c82ceec729504a80e33f5b1 /crates/ra_analysis/tests
parent9a7db8fa009c612168ef16f6ed72315b5406ed09 (diff)
parent69d07df201307fb7c539cdb20b8f1c1c12840386 (diff)
Merge #158
158: Complete crate:: paths r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
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}