diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-24 17:16:32 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-24 17:16:32 +0100 |
commit | 072260ffe89b278cd47d972f27c350a125bc75a5 (patch) | |
tree | 08cccd64582510ce2c82ceec729504a80e33f5b1 /crates/ra_analysis/tests | |
parent | 9a7db8fa009c612168ef16f6ed72315b5406ed09 (diff) | |
parent | 69d07df201307fb7c539cdb20b8f1c1c12840386 (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.rs | 14 |
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] | ||
269 | fn 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 | } | ||