6953: Add test_rename_bind_pat r=bjorn3 a=bjorn3

Fixes #2976

Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
This commit is contained in:
bors[bot] 2020-12-19 18:56:50 +00:00 committed by GitHub
commit feff4f3a04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1488,4 +1488,39 @@ impl<'yeeee> Foo<'yeeee> for &'yeeee () {
"#,
)
}
#[test]
fn test_rename_bind_pat() {
check(
"new_name",
r#"
fn main() {
enum CustomOption<T> {
None,
Some(T),
}
let test_variable = CustomOption::Some(22);
match test_variable {
CustomOption::Some(foo<|>) if foo == 11 => {}
_ => (),
}
}"#,
r#"
fn main() {
enum CustomOption<T> {
None,
Some(T),
}
let test_variable = CustomOption::Some(22);
match test_variable {
CustomOption::Some(new_name) if new_name == 11 => {}
_ => (),
}
}"#,
);
}
}