diff options
Diffstat (limited to 'crates/ra_ide/src/references')
-rw-r--r-- | crates/ra_ide/src/references/rename.rs | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/crates/ra_ide/src/references/rename.rs b/crates/ra_ide/src/references/rename.rs index 7d1190af9..9acc6158a 100644 --- a/crates/ra_ide/src/references/rename.rs +++ b/crates/ra_ide/src/references/rename.rs | |||
@@ -250,6 +250,63 @@ mod tests { | |||
250 | } | 250 | } |
251 | 251 | ||
252 | #[test] | 252 | #[test] |
253 | fn test_rename_for_macro_args_rev() { | ||
254 | test_rename( | ||
255 | r#" | ||
256 | macro_rules! foo {($i:ident) => {$i} } | ||
257 | fn main() { | ||
258 | let a = "test"; | ||
259 | foo!(a<|>); | ||
260 | }"#, | ||
261 | "b", | ||
262 | r#" | ||
263 | macro_rules! foo {($i:ident) => {$i} } | ||
264 | fn main() { | ||
265 | let b = "test"; | ||
266 | foo!(b); | ||
267 | }"#, | ||
268 | ); | ||
269 | } | ||
270 | |||
271 | #[test] | ||
272 | fn test_rename_for_macro_define_fn() { | ||
273 | test_rename( | ||
274 | r#" | ||
275 | macro_rules! define_fn {($id:ident) => { fn $id{} }} | ||
276 | define_fn!(foo); | ||
277 | fn main() { | ||
278 | fo<|>o(); | ||
279 | }"#, | ||
280 | "bar", | ||
281 | r#" | ||
282 | macro_rules! define_fn {($id:ident) => { fn $id{} }} | ||
283 | define_fn!(bar); | ||
284 | fn main() { | ||
285 | bar(); | ||
286 | }"#, | ||
287 | ); | ||
288 | } | ||
289 | |||
290 | #[test] | ||
291 | fn test_rename_for_macro_define_fn_rev() { | ||
292 | test_rename( | ||
293 | r#" | ||
294 | macro_rules! define_fn {($id:ident) => { fn $id{} }} | ||
295 | define_fn!(fo<|>o); | ||
296 | fn main() { | ||
297 | foo(); | ||
298 | }"#, | ||
299 | "bar", | ||
300 | r#" | ||
301 | macro_rules! define_fn {($id:ident) => { fn $id{} }} | ||
302 | define_fn!(bar); | ||
303 | fn main() { | ||
304 | bar(); | ||
305 | }"#, | ||
306 | ); | ||
307 | } | ||
308 | |||
309 | #[test] | ||
253 | fn test_rename_for_param_inside() { | 310 | fn test_rename_for_param_inside() { |
254 | test_rename( | 311 | test_rename( |
255 | r#" | 312 | r#" |