aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres/tests
diff options
context:
space:
mode:
authorAlexander Andreev <[email protected]>2019-07-29 07:54:40 +0100
committerAlexander Andreev <[email protected]>2019-07-29 07:54:40 +0100
commit538ec1122baeccd85ab672fd0a9f1186d2171058 (patch)
treebd678af17b28232a43ac8c563d019d8a736641b5 /crates/ra_hir/src/nameres/tests
parentde278d164906d6d29974790c5a4db28303692484 (diff)
Added resolve modules inside inline module
#1510
Diffstat (limited to 'crates/ra_hir/src/nameres/tests')
-rw-r--r--crates/ra_hir/src/nameres/tests/mods.rs53
1 files changed, 38 insertions, 15 deletions
diff --git a/crates/ra_hir/src/nameres/tests/mods.rs b/crates/ra_hir/src/nameres/tests/mods.rs
index d714a3276..382728149 100644
--- a/crates/ra_hir/src/nameres/tests/mods.rs
+++ b/crates/ra_hir/src/nameres/tests/mods.rs
@@ -336,10 +336,10 @@ fn module_resolution_explicit_path_mod_rs_with_win_separator() {
336 "###); 336 "###);
337} 337}
338 338
339// FIXME: issue #1510. not support out-of-line modules inside inline. 339// FIXME: issue #1529. not support out-of-line modules inside inline.
340#[test] 340#[test]
341#[ignore] 341#[ignore]
342fn module_resolution_decl_inside_inline_module() { 342fn module_resolution_decl_inside_inline_module_with_path_attribute() {
343 let map = def_map_with_crate_graph( 343 let map = def_map_with_crate_graph(
344 r###" 344 r###"
345 //- /main.rs 345 //- /main.rs
@@ -368,10 +368,39 @@ fn module_resolution_decl_inside_inline_module() {
368 "###); 368 "###);
369} 369}
370 370
371// FIXME: issue #1510. not support out-of-line modules inside inline. 371#[test]
372fn module_resolution_decl_inside_inline_module() {
373 let map = def_map_with_crate_graph(
374 r###"
375 //- /main.rs
376 mod foo {
377 mod bar;
378 }
379
380 //- /foo/bar.rs
381 pub struct Baz;
382 "###,
383 crate_graph! {
384 "main": ("/main.rs", []),
385 },
386 );
387
388 assert_snapshot_matches!(map, @r###"
389 ⋮crate
390 ⋮foo: t
391
392 ⋮crate::foo
393 ⋮bar: t
394
395 ⋮crate::foo::bar
396 ⋮Baz: t v
397 "###);
398}
399
400// FIXME: issue #1529. not support out-of-line modules inside inline.
372#[test] 401#[test]
373#[ignore] 402#[ignore]
374fn module_resolution_decl_inside_inline_module_2() { 403fn module_resolution_decl_inside_inline_module_2_with_path_attribute() {
375 let map = def_map_with_crate_graph( 404 let map = def_map_with_crate_graph(
376 r###" 405 r###"
377 //- /main.rs 406 //- /main.rs
@@ -400,7 +429,7 @@ fn module_resolution_decl_inside_inline_module_2() {
400 "###); 429 "###);
401} 430}
402 431
403// FIXME: issue #1510. not support out-of-line modules inside inline. 432// FIXME: issue #1529. not support out-of-line modules inside inline.
404#[test] 433#[test]
405#[ignore] 434#[ignore]
406fn module_resolution_decl_inside_inline_module_3() { 435fn module_resolution_decl_inside_inline_module_3() {
@@ -433,7 +462,7 @@ fn module_resolution_decl_inside_inline_module_3() {
433 "###); 462 "###);
434} 463}
435 464
436// FIXME: issue #1510. not support out-of-line modules inside inline. 465// FIXME: issue #1529. not support out-of-line modules inside inline.
437#[test] 466#[test]
438#[ignore] 467#[ignore]
439fn module_resolution_decl_inside_inline_module_empty_path() { 468fn module_resolution_decl_inside_inline_module_empty_path() {
@@ -491,7 +520,7 @@ fn module_resolution_decl_empty_path() {
491 "###); 520 "###);
492} 521}
493 522
494// FIXME: issue #1510. not support out-of-line modules inside inline. 523// FIXME: issue #1529. not support out-of-line modules inside inline.
495#[test] 524#[test]
496#[ignore] 525#[ignore]
497fn module_resolution_decl_inside_inline_module_relative_path() { 526fn module_resolution_decl_inside_inline_module_relative_path() {
@@ -523,9 +552,7 @@ fn module_resolution_decl_inside_inline_module_relative_path() {
523 "###); 552 "###);
524} 553}
525 554
526// FIXME: issue #1510. not support out-of-line modules inside inline.
527#[test] 555#[test]
528#[ignore]
529fn module_resolution_decl_inside_inline_module_in_crate_root() { 556fn module_resolution_decl_inside_inline_module_in_crate_root() {
530 let map = def_map_with_crate_graph( 557 let map = def_map_with_crate_graph(
531 r###" 558 r###"
@@ -557,9 +584,7 @@ fn module_resolution_decl_inside_inline_module_in_crate_root() {
557 "###); 584 "###);
558} 585}
559 586
560// FIXME: issue #1510. not support out-of-line modules inside inline.
561#[test] 587#[test]
562#[ignore]
563fn module_resolution_decl_inside_inline_module_in_mod_rs() { 588fn module_resolution_decl_inside_inline_module_in_mod_rs() {
564 let map = def_map_with_crate_graph( 589 let map = def_map_with_crate_graph(
565 r###" 590 r###"
@@ -597,9 +622,7 @@ fn module_resolution_decl_inside_inline_module_in_mod_rs() {
597 "###); 622 "###);
598} 623}
599 624
600// FIXME: issue #1510. not support out-of-line modules inside inline.
601#[test] 625#[test]
602#[ignore]
603fn module_resolution_decl_inside_inline_module_in_non_crate_root() { 626fn module_resolution_decl_inside_inline_module_in_non_crate_root() {
604 let map = def_map_with_crate_graph( 627 let map = def_map_with_crate_graph(
605 r###" 628 r###"
@@ -613,7 +636,7 @@ fn module_resolution_decl_inside_inline_module_in_non_crate_root() {
613 } 636 }
614 use self::bar::baz::Baz; 637 use self::bar::baz::Baz;
615 638
616 //- /foo/bar/qwe.rs 639 //- /bar/qwe.rs
617 pub struct Baz; 640 pub struct Baz;
618 "###, 641 "###,
619 crate_graph! { 642 crate_graph! {
@@ -637,7 +660,7 @@ fn module_resolution_decl_inside_inline_module_in_non_crate_root() {
637 "###); 660 "###);
638} 661}
639 662
640// FIXME: issue #1510. not support out-of-line modules inside inline. 663// FIXME: issue #1529. not support out-of-line modules inside inline.
641#[test] 664#[test]
642#[ignore] 665#[ignore]
643fn module_resolution_decl_inside_inline_module_in_non_crate_root_2() { 666fn module_resolution_decl_inside_inline_module_in_non_crate_root_2() {