aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-03 20:29:21 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-03 20:29:21 +0100
commit4e8664d9d37021e85d72b6228fa45e7edf4a1a74 (patch)
treefd19fc2830a5621bed1735bdbe892bd17905e5e0 /crates/ra_hir/src/nameres
parent2b2cd829b0f95aef338227deb05ec7503dae9b6c (diff)
parent6263aa13d0eed983827d14fa39bf6490eb27e7a5 (diff)
Merge #1478
1478: [WIP] Added resolve submodules with raw name r=matklad a=andreevlex #1211 Co-authored-by: Alexander Andreev <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r--crates/ra_hir/src/nameres/tests.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs
index adac814d9..07b533e29 100644
--- a/crates/ra_hir/src/nameres/tests.rs
+++ b/crates/ra_hir/src/nameres/tests.rs
@@ -339,6 +339,32 @@ fn module_resolution_works_for_non_standard_filenames() {
339} 339}
340 340
341#[test] 341#[test]
342fn module_resolution_works_for_raw_modules() {
343 let map = def_map_with_crate_graph(
344 "
345 //- /library.rs
346 mod r#async;
347 use self::r#async::Bar;
348
349 //- /async.rs
350 pub struct Bar;
351 ",
352 crate_graph! {
353 "library": ("/library.rs", []),
354 },
355 );
356
357 assert_snapshot_matches!(map, @r###"
358 ⋮crate
359 ⋮Bar: t v
360 ⋮async: t
361
362 ⋮crate::async
363 ⋮Bar: t v
364 "###);
365}
366
367#[test]
342fn name_res_works_for_broken_modules() { 368fn name_res_works_for_broken_modules() {
343 covers!(name_res_works_for_broken_modules); 369 covers!(name_res_works_for_broken_modules);
344 let map = def_map( 370 let map = def_map(