diff options
Diffstat (limited to 'crates/ra_ide_api/src/runnables.rs')
-rw-r--r-- | crates/ra_ide_api/src/runnables.rs | 72 |
1 files changed, 68 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/runnables.rs b/crates/ra_ide_api/src/runnables.rs index 07412a9ef..09c082de9 100644 --- a/crates/ra_ide_api/src/runnables.rs +++ b/crates/ra_ide_api/src/runnables.rs | |||
@@ -92,7 +92,26 @@ mod tests { | |||
92 | "#, | 92 | "#, |
93 | ); | 93 | ); |
94 | let runnables = analysis.runnables(pos.file_id).unwrap(); | 94 | let runnables = analysis.runnables(pos.file_id).unwrap(); |
95 | assert_debug_snapshot_matches!("runnables", &runnables) | 95 | assert_debug_snapshot_matches!(&runnables, |
96 | @r#"[ | ||
97 | Runnable { | ||
98 | range: [1; 21), | ||
99 | kind: Bin, | ||
100 | }, | ||
101 | Runnable { | ||
102 | range: [22; 46), | ||
103 | kind: Test { | ||
104 | name: "test_foo", | ||
105 | }, | ||
106 | }, | ||
107 | Runnable { | ||
108 | range: [47; 81), | ||
109 | kind: Test { | ||
110 | name: "test_foo", | ||
111 | }, | ||
112 | }, | ||
113 | ]"# | ||
114 | ); | ||
96 | } | 115 | } |
97 | 116 | ||
98 | #[test] | 117 | #[test] |
@@ -108,7 +127,22 @@ mod tests { | |||
108 | "#, | 127 | "#, |
109 | ); | 128 | ); |
110 | let runnables = analysis.runnables(pos.file_id).unwrap(); | 129 | let runnables = analysis.runnables(pos.file_id).unwrap(); |
111 | assert_debug_snapshot_matches!("runnables_module", &runnables) | 130 | assert_debug_snapshot_matches!(&runnables, |
131 | @r#"[ | ||
132 | Runnable { | ||
133 | range: [1; 59), | ||
134 | kind: TestMod { | ||
135 | path: "test_mod", | ||
136 | }, | ||
137 | }, | ||
138 | Runnable { | ||
139 | range: [28; 57), | ||
140 | kind: Test { | ||
141 | name: "test_foo1", | ||
142 | }, | ||
143 | }, | ||
144 | ]"# | ||
145 | ); | ||
112 | } | 146 | } |
113 | 147 | ||
114 | #[test] | 148 | #[test] |
@@ -126,7 +160,22 @@ mod tests { | |||
126 | "#, | 160 | "#, |
127 | ); | 161 | ); |
128 | let runnables = analysis.runnables(pos.file_id).unwrap(); | 162 | let runnables = analysis.runnables(pos.file_id).unwrap(); |
129 | assert_debug_snapshot_matches!("runnables_one_depth_layer_module", &runnables) | 163 | assert_debug_snapshot_matches!(&runnables, |
164 | @r#"[ | ||
165 | Runnable { | ||
166 | range: [23; 85), | ||
167 | kind: TestMod { | ||
168 | path: "foo::test_mod", | ||
169 | }, | ||
170 | }, | ||
171 | Runnable { | ||
172 | range: [46; 79), | ||
173 | kind: Test { | ||
174 | name: "test_foo1", | ||
175 | }, | ||
176 | }, | ||
177 | ]"# | ||
178 | ); | ||
130 | } | 179 | } |
131 | 180 | ||
132 | #[test] | 181 | #[test] |
@@ -146,7 +195,22 @@ mod tests { | |||
146 | "#, | 195 | "#, |
147 | ); | 196 | ); |
148 | let runnables = analysis.runnables(pos.file_id).unwrap(); | 197 | let runnables = analysis.runnables(pos.file_id).unwrap(); |
149 | assert_debug_snapshot_matches!("runnables_multiple_depth_module", &runnables) | 198 | assert_debug_snapshot_matches!(&runnables, |
199 | @r#"[ | ||
200 | Runnable { | ||
201 | range: [41; 115), | ||
202 | kind: TestMod { | ||
203 | path: "foo::bar::test_mod", | ||
204 | }, | ||
205 | }, | ||
206 | Runnable { | ||
207 | range: [68; 105), | ||
208 | kind: Test { | ||
209 | name: "test_foo1", | ||
210 | }, | ||
211 | }, | ||
212 | ]"# | ||
213 | ); | ||
150 | } | 214 | } |
151 | 215 | ||
152 | #[test] | 216 | #[test] |