diff options
Diffstat (limited to 'crates/ra_hir/src/nameres/tests/globs.rs')
-rw-r--r-- | crates/ra_hir/src/nameres/tests/globs.rs | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/crates/ra_hir/src/nameres/tests/globs.rs b/crates/ra_hir/src/nameres/tests/globs.rs deleted file mode 100644 index 7ac22b47b..000000000 --- a/crates/ra_hir/src/nameres/tests/globs.rs +++ /dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | use super::*; | ||
2 | |||
3 | #[test] | ||
4 | fn glob_1() { | ||
5 | let map = def_map( | ||
6 | " | ||
7 | //- /lib.rs | ||
8 | mod foo; | ||
9 | use foo::*; | ||
10 | |||
11 | //- /foo/mod.rs | ||
12 | pub mod bar; | ||
13 | pub use self::bar::Baz; | ||
14 | pub struct Foo; | ||
15 | |||
16 | //- /foo/bar.rs | ||
17 | pub struct Baz; | ||
18 | ", | ||
19 | ); | ||
20 | assert_snapshot!(map, @r###" | ||
21 | ⋮crate | ||
22 | ⋮Baz: t v | ||
23 | ⋮Foo: t v | ||
24 | ⋮bar: t | ||
25 | ⋮foo: t | ||
26 | ⋮ | ||
27 | ⋮crate::foo | ||
28 | ⋮Baz: t v | ||
29 | ⋮Foo: t v | ||
30 | ⋮bar: t | ||
31 | ⋮ | ||
32 | ⋮crate::foo::bar | ||
33 | ⋮Baz: t v | ||
34 | "### | ||
35 | ); | ||
36 | } | ||
37 | |||
38 | #[test] | ||
39 | fn glob_2() { | ||
40 | let map = def_map( | ||
41 | " | ||
42 | //- /lib.rs | ||
43 | mod foo; | ||
44 | use foo::*; | ||
45 | |||
46 | //- /foo/mod.rs | ||
47 | pub mod bar; | ||
48 | pub use self::bar::*; | ||
49 | pub struct Foo; | ||
50 | |||
51 | //- /foo/bar.rs | ||
52 | pub struct Baz; | ||
53 | pub use super::*; | ||
54 | ", | ||
55 | ); | ||
56 | assert_snapshot!(map, @r###" | ||
57 | ⋮crate | ||
58 | ⋮Baz: t v | ||
59 | ⋮Foo: t v | ||
60 | ⋮bar: t | ||
61 | ⋮foo: t | ||
62 | ⋮ | ||
63 | ⋮crate::foo | ||
64 | ⋮Baz: t v | ||
65 | ⋮Foo: t v | ||
66 | ⋮bar: t | ||
67 | ⋮ | ||
68 | ⋮crate::foo::bar | ||
69 | ⋮Baz: t v | ||
70 | ⋮Foo: t v | ||
71 | ⋮bar: t | ||
72 | "### | ||
73 | ); | ||
74 | } | ||
75 | |||
76 | #[test] | ||
77 | fn glob_across_crates() { | ||
78 | covers!(glob_across_crates); | ||
79 | let map = def_map_with_crate_graph( | ||
80 | " | ||
81 | //- /main.rs | ||
82 | use test_crate::*; | ||
83 | |||
84 | //- /lib.rs | ||
85 | pub struct Baz; | ||
86 | ", | ||
87 | crate_graph! { | ||
88 | "main": ("/main.rs", ["test_crate"]), | ||
89 | "test_crate": ("/lib.rs", []), | ||
90 | }, | ||
91 | ); | ||
92 | assert_snapshot!(map, @r###" | ||
93 | ⋮crate | ||
94 | ⋮Baz: t v | ||
95 | "### | ||
96 | ); | ||
97 | } | ||
98 | |||
99 | #[test] | ||
100 | fn glob_enum() { | ||
101 | covers!(glob_enum); | ||
102 | let map = def_map( | ||
103 | " | ||
104 | //- /lib.rs | ||
105 | enum Foo { | ||
106 | Bar, Baz | ||
107 | } | ||
108 | use self::Foo::*; | ||
109 | ", | ||
110 | ); | ||
111 | assert_snapshot!(map, @r###" | ||
112 | ⋮crate | ||
113 | ⋮Bar: t v | ||
114 | ⋮Baz: t v | ||
115 | ⋮Foo: t | ||
116 | "### | ||
117 | ); | ||
118 | } | ||