aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbjorn3 <[email protected]>2020-12-19 18:37:19 +0000
committerbjorn3 <[email protected]>2020-12-19 18:55:44 +0000
commit9fe85e1fdf0954b4d4c563ab4c40b8823ce5c6c4 (patch)
tree15463d8527b80b6d4883ee68e637631d97a8afad /crates
parent8b73135b11ba241aa92ca4242166f563b42bf05d (diff)
Add test_rename_bind_pat
Diffstat (limited to 'crates')
-rw-r--r--crates/ide/src/references/rename.rs35
1 files changed, 35 insertions, 0 deletions
diff --git a/crates/ide/src/references/rename.rs b/crates/ide/src/references/rename.rs
index 56e923841..cd721b7eb 100644
--- a/crates/ide/src/references/rename.rs
+++ b/crates/ide/src/references/rename.rs
@@ -1488,4 +1488,39 @@ impl<'yeeee> Foo<'yeeee> for &'yeeee () {
1488"#, 1488"#,
1489 ) 1489 )
1490 } 1490 }
1491
1492 #[test]
1493 fn test_rename_bind_pat() {
1494 check(
1495 "new_name",
1496 r#"
1497fn main() {
1498 enum CustomOption<T> {
1499 None,
1500 Some(T),
1501 }
1502
1503 let test_variable = CustomOption::Some(22);
1504
1505 match test_variable {
1506 CustomOption::Some(foo<|>) if foo == 11 => {}
1507 _ => (),
1508 }
1509}"#,
1510 r#"
1511fn main() {
1512 enum CustomOption<T> {
1513 None,
1514 Some(T),
1515 }
1516
1517 let test_variable = CustomOption::Some(22);
1518
1519 match test_variable {
1520 CustomOption::Some(new_name) if new_name == 11 => {}
1521 _ => (),
1522 }
1523}"#,
1524 );
1525 }
1491} 1526}