aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres/tests
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-08-29 14:49:10 +0100
committerAleksey Kladov <[email protected]>2019-08-29 15:04:01 +0100
commit0f6c048ce1a621ccd3e2080ec5aafbd053c516f4 (patch)
tree4aa7826d1b9a7222ad64085f136a1615d7daa7a5 /crates/ra_hir/src/nameres/tests
parent5a99184967c89992df4544d0c1ca27d79946a1a7 (diff)
:arrow_up: insta
Diffstat (limited to 'crates/ra_hir/src/nameres/tests')
-rw-r--r--crates/ra_hir/src/nameres/tests/globs.rs8
-rw-r--r--crates/ra_hir/src/nameres/tests/macros.rs8
-rw-r--r--crates/ra_hir/src/nameres/tests/mods.rs56
-rw-r--r--crates/ra_hir/src/nameres/tests/primitives.rs2
4 files changed, 37 insertions, 37 deletions
diff --git a/crates/ra_hir/src/nameres/tests/globs.rs b/crates/ra_hir/src/nameres/tests/globs.rs
index e1519ca6b..7ac22b47b 100644
--- a/crates/ra_hir/src/nameres/tests/globs.rs
+++ b/crates/ra_hir/src/nameres/tests/globs.rs
@@ -17,7 +17,7 @@ fn glob_1() {
17 pub struct Baz; 17 pub struct Baz;
18 ", 18 ",
19 ); 19 );
20 assert_snapshot_matches!(map, @r###" 20 assert_snapshot!(map, @r###"
21 ⋮crate 21 ⋮crate
22 ⋮Baz: t v 22 ⋮Baz: t v
23 ⋮Foo: t v 23 ⋮Foo: t v
@@ -53,7 +53,7 @@ fn glob_2() {
53 pub use super::*; 53 pub use super::*;
54 ", 54 ",
55 ); 55 );
56 assert_snapshot_matches!(map, @r###" 56 assert_snapshot!(map, @r###"
57 ⋮crate 57 ⋮crate
58 ⋮Baz: t v 58 ⋮Baz: t v
59 ⋮Foo: t v 59 ⋮Foo: t v
@@ -89,7 +89,7 @@ fn glob_across_crates() {
89 "test_crate": ("/lib.rs", []), 89 "test_crate": ("/lib.rs", []),
90 }, 90 },
91 ); 91 );
92 assert_snapshot_matches!(map, @r###" 92 assert_snapshot!(map, @r###"
93 ⋮crate 93 ⋮crate
94 ⋮Baz: t v 94 ⋮Baz: t v
95 "### 95 "###
@@ -108,7 +108,7 @@ fn glob_enum() {
108 use self::Foo::*; 108 use self::Foo::*;
109 ", 109 ",
110 ); 110 );
111 assert_snapshot_matches!(map, @r###" 111 assert_snapshot!(map, @r###"
112 ⋮crate 112 ⋮crate
113 ⋮Bar: t v 113 ⋮Bar: t v
114 ⋮Baz: t v 114 ⋮Baz: t v
diff --git a/crates/ra_hir/src/nameres/tests/macros.rs b/crates/ra_hir/src/nameres/tests/macros.rs
index 4e04740eb..631df2cef 100644
--- a/crates/ra_hir/src/nameres/tests/macros.rs
+++ b/crates/ra_hir/src/nameres/tests/macros.rs
@@ -17,7 +17,7 @@ fn macro_rules_are_globally_visible() {
17 structs!(Bar, Baz); 17 structs!(Bar, Baz);
18 ", 18 ",
19 ); 19 );
20 assert_snapshot_matches!(map, @r###" 20 assert_snapshot!(map, @r###"
21 ⋮crate 21 ⋮crate
22 ⋮Foo: t v 22 ⋮Foo: t v
23 ⋮nested: t 23 ⋮nested: t
@@ -45,7 +45,7 @@ fn macro_rules_can_define_modules() {
45 struct X; 45 struct X;
46 ", 46 ",
47 ); 47 );
48 assert_snapshot_matches!(map, @r###" 48 assert_snapshot!(map, @r###"
49 ⋮crate 49 ⋮crate
50 ⋮m: m 50 ⋮m: m
51 ⋮n1: t 51 ⋮n1: t
@@ -82,7 +82,7 @@ fn macro_rules_from_other_crates_are_visible() {
82 "foo": ("/lib.rs", []), 82 "foo": ("/lib.rs", []),
83 }, 83 },
84 ); 84 );
85 assert_snapshot_matches!(map, @r###" 85 assert_snapshot!(map, @r###"
86 ⋮crate 86 ⋮crate
87 ⋮Bar: t v 87 ⋮Bar: t v
88 ⋮Foo: t v 88 ⋮Foo: t v
@@ -129,7 +129,7 @@ fn unexpanded_macro_should_expand_by_fixedpoint_loop() {
129 "foo": ("/lib.rs", []), 129 "foo": ("/lib.rs", []),
130 }, 130 },
131 ); 131 );
132 assert_snapshot_matches!(map, @r###" 132 assert_snapshot!(map, @r###"
133 ⋮crate 133 ⋮crate
134 ⋮Foo: t v 134 ⋮Foo: t v
135 ⋮bar: m 135 ⋮bar: m
diff --git a/crates/ra_hir/src/nameres/tests/mods.rs b/crates/ra_hir/src/nameres/tests/mods.rs
index 6dd18df1a..4f8398460 100644
--- a/crates/ra_hir/src/nameres/tests/mods.rs
+++ b/crates/ra_hir/src/nameres/tests/mods.rs
@@ -19,7 +19,7 @@ fn name_res_works_for_broken_modules() {
19 pub struct Baz; 19 pub struct Baz;
20 ", 20 ",
21 ); 21 );
22 assert_snapshot_matches!(map, @r###" 22 assert_snapshot!(map, @r###"
23 ⋮crate 23 ⋮crate
24 ⋮Baz: _ 24 ⋮Baz: _
25 "###); 25 "###);
@@ -41,7 +41,7 @@ fn module_resolution_works_for_non_standard_filenames() {
41 }, 41 },
42 ); 42 );
43 43
44 assert_snapshot_matches!(map, @r###" 44 assert_snapshot!(map, @r###"
45 ⋮crate 45 ⋮crate
46 ⋮Bar: t v 46 ⋮Bar: t v
47 ⋮foo: t 47 ⋮foo: t
@@ -67,7 +67,7 @@ fn module_resolution_works_for_raw_modules() {
67 }, 67 },
68 ); 68 );
69 69
70 assert_snapshot_matches!(map, @r###" 70 assert_snapshot!(map, @r###"
71 ⋮crate 71 ⋮crate
72 ⋮Bar: t v 72 ⋮Bar: t v
73 ⋮async: t 73 ⋮async: t
@@ -94,7 +94,7 @@ fn module_resolution_decl_path() {
94 }, 94 },
95 ); 95 );
96 96
97 assert_snapshot_matches!(map, @r###" 97 assert_snapshot!(map, @r###"
98 ⋮crate 98 ⋮crate
99 ⋮Bar: t v 99 ⋮Bar: t v
100 ⋮foo: t 100 ⋮foo: t
@@ -110,7 +110,7 @@ fn module_resolution_module_with_path_in_mod_rs() {
110 r###" 110 r###"
111 //- /main.rs 111 //- /main.rs
112 mod foo; 112 mod foo;
113 113
114 //- /foo/mod.rs 114 //- /foo/mod.rs
115 #[path = "baz.rs"] 115 #[path = "baz.rs"]
116 pub mod bar; 116 pub mod bar;
@@ -125,7 +125,7 @@ fn module_resolution_module_with_path_in_mod_rs() {
125 }, 125 },
126 ); 126 );
127 127
128 assert_snapshot_matches!(map, @r###" 128 assert_snapshot!(map, @r###"
129 ⋮crate 129 ⋮crate
130 ⋮foo: t 130 ⋮foo: t
131 131
@@ -144,7 +144,7 @@ fn module_resolution_module_with_path_non_crate_root() {
144 r###" 144 r###"
145 //- /main.rs 145 //- /main.rs
146 mod foo; 146 mod foo;
147 147
148 //- /foo.rs 148 //- /foo.rs
149 #[path = "baz.rs"] 149 #[path = "baz.rs"]
150 pub mod bar; 150 pub mod bar;
@@ -159,7 +159,7 @@ fn module_resolution_module_with_path_non_crate_root() {
159 }, 159 },
160 ); 160 );
161 161
162 assert_snapshot_matches!(map, @r###" 162 assert_snapshot!(map, @r###"
163 ⋮crate 163 ⋮crate
164 ⋮foo: t 164 ⋮foo: t
165 165
@@ -189,7 +189,7 @@ fn module_resolution_module_decl_path_super() {
189 }, 189 },
190 ); 190 );
191 191
192 assert_snapshot_matches!(map, @r###" 192 assert_snapshot!(map, @r###"
193 ⋮crate 193 ⋮crate
194 ⋮Baz: t v 194 ⋮Baz: t v
195 ⋮foo: t 195 ⋮foo: t
@@ -215,7 +215,7 @@ fn module_resolution_explicit_path_mod_rs() {
215 }, 215 },
216 ); 216 );
217 217
218 assert_snapshot_matches!(map, @r###" 218 assert_snapshot!(map, @r###"
219 ⋮crate 219 ⋮crate
220 ⋮foo: t 220 ⋮foo: t
221 221
@@ -243,7 +243,7 @@ fn module_resolution_relative_path() {
243 }, 243 },
244 ); 244 );
245 245
246 assert_snapshot_matches!(map, @r###" 246 assert_snapshot!(map, @r###"
247 ⋮crate 247 ⋮crate
248 ⋮foo: t 248 ⋮foo: t
249 249
@@ -274,7 +274,7 @@ fn module_resolution_relative_path_2() {
274 }, 274 },
275 ); 275 );
276 276
277 assert_snapshot_matches!(map, @r###" 277 assert_snapshot!(map, @r###"
278 ⋮crate 278 ⋮crate
279 ⋮foo: t 279 ⋮foo: t
280 280
@@ -302,7 +302,7 @@ fn module_resolution_explicit_path_mod_rs_2() {
302 }, 302 },
303 ); 303 );
304 304
305 assert_snapshot_matches!(map, @r###" 305 assert_snapshot!(map, @r###"
306 ⋮crate 306 ⋮crate
307 ⋮foo: t 307 ⋮foo: t
308 308
@@ -327,7 +327,7 @@ fn module_resolution_explicit_path_mod_rs_with_win_separator() {
327 }, 327 },
328 ); 328 );
329 329
330 assert_snapshot_matches!(map, @r###" 330 assert_snapshot!(map, @r###"
331 ⋮crate 331 ⋮crate
332 ⋮foo: t 332 ⋮foo: t
333 333
@@ -354,7 +354,7 @@ fn module_resolution_decl_inside_inline_module_with_path_attribute() {
354 }, 354 },
355 ); 355 );
356 356
357 assert_snapshot_matches!(map, @r###" 357 assert_snapshot!(map, @r###"
358 ⋮crate 358 ⋮crate
359 ⋮foo: t 359 ⋮foo: t
360 360
@@ -383,7 +383,7 @@ fn module_resolution_decl_inside_inline_module() {
383 }, 383 },
384 ); 384 );
385 385
386 assert_snapshot_matches!(map, @r###" 386 assert_snapshot!(map, @r###"
387 ⋮crate 387 ⋮crate
388 ⋮foo: t 388 ⋮foo: t
389 389
@@ -413,7 +413,7 @@ fn module_resolution_decl_inside_inline_module_2_with_path_attribute() {
413 }, 413 },
414 ); 414 );
415 415
416 assert_snapshot_matches!(map, @r###" 416 assert_snapshot!(map, @r###"
417 ⋮crate 417 ⋮crate
418 ⋮foo: t 418 ⋮foo: t
419 419
@@ -444,7 +444,7 @@ fn module_resolution_decl_inside_inline_module_3() {
444 }, 444 },
445 ); 445 );
446 446
447 assert_snapshot_matches!(map, @r###" 447 assert_snapshot!(map, @r###"
448 ⋮crate 448 ⋮crate
449 ⋮foo: t 449 ⋮foo: t
450 450
@@ -475,7 +475,7 @@ fn module_resolution_decl_inside_inline_module_empty_path() {
475 }, 475 },
476 ); 476 );
477 477
478 assert_snapshot_matches!(map, @r###" 478 assert_snapshot!(map, @r###"
479 ⋮crate 479 ⋮crate
480 ⋮foo: t 480 ⋮foo: t
481 481
@@ -503,7 +503,7 @@ fn module_resolution_decl_empty_path() {
503 }, 503 },
504 ); 504 );
505 505
506 assert_snapshot_matches!(map, @r###" 506 assert_snapshot!(map, @r###"
507 ⋮crate 507 ⋮crate
508 ⋮foo: t 508 ⋮foo: t
509 509
@@ -530,7 +530,7 @@ fn module_resolution_decl_inside_inline_module_relative_path() {
530 }, 530 },
531 ); 531 );
532 532
533 assert_snapshot_matches!(map, @r###" 533 assert_snapshot!(map, @r###"
534 ⋮crate 534 ⋮crate
535 ⋮foo: t 535 ⋮foo: t
536 536
@@ -561,7 +561,7 @@ fn module_resolution_decl_inside_inline_module_in_crate_root() {
561 }, 561 },
562 ); 562 );
563 563
564 assert_snapshot_matches!(map, @r###" 564 assert_snapshot!(map, @r###"
565 ⋮crate 565 ⋮crate
566 ⋮Baz: t v 566 ⋮Baz: t v
567 ⋮foo: t 567 ⋮foo: t
@@ -596,7 +596,7 @@ fn module_resolution_decl_inside_inline_module_in_mod_rs() {
596 }, 596 },
597 ); 597 );
598 598
599 assert_snapshot_matches!(map, @r###" 599 assert_snapshot!(map, @r###"
600 ⋮crate 600 ⋮crate
601 ⋮foo: t 601 ⋮foo: t
602 602
@@ -634,7 +634,7 @@ fn module_resolution_decl_inside_inline_module_in_non_crate_root() {
634 }, 634 },
635 ); 635 );
636 636
637 assert_snapshot_matches!(map, @r###" 637 assert_snapshot!(map, @r###"
638 ⋮crate 638 ⋮crate
639 ⋮foo: t 639 ⋮foo: t
640 640
@@ -672,7 +672,7 @@ fn module_resolution_decl_inside_inline_module_in_non_crate_root_2() {
672 }, 672 },
673 ); 673 );
674 674
675 assert_snapshot_matches!(map, @r###" 675 assert_snapshot!(map, @r###"
676 ⋮crate 676 ⋮crate
677 ⋮foo: t 677 ⋮foo: t
678 678
@@ -701,8 +701,8 @@ fn unresolved_module_diagnostics() {
701 ) 701 )
702 .diagnostics(); 702 .diagnostics();
703 703
704 assert_snapshot_matches!(diagnostics, @r###" 704 assert_snapshot!(diagnostics, @r###"
705"mod bar;": unresolved module 705 "mod bar;": unresolved module
706"### 706 "###
707 ); 707 );
708} 708}
diff --git a/crates/ra_hir/src/nameres/tests/primitives.rs b/crates/ra_hir/src/nameres/tests/primitives.rs
index 734744835..0e2708658 100644
--- a/crates/ra_hir/src/nameres/tests/primitives.rs
+++ b/crates/ra_hir/src/nameres/tests/primitives.rs
@@ -12,7 +12,7 @@ fn primitive_reexport() {
12 pub use i32 as int; 12 pub use i32 as int;
13 ", 13 ",
14 ); 14 );
15 assert_snapshot_matches!(map, @r###" 15 assert_snapshot!(map, @r###"
16 ⋮crate 16 ⋮crate
17 ⋮foo: t 17 ⋮foo: t
18 ⋮int: t 18 ⋮int: t