fill_match_arms bind pattern test
This commit is contained in:
parent
017331a53c
commit
34db4edb80
1 changed files with 34 additions and 0 deletions
|
|
@ -350,6 +350,40 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn partial_fill_bind_pat() {
|
||||
check_assist(
|
||||
fill_match_arms,
|
||||
r#"
|
||||
enum A {
|
||||
As,
|
||||
Bs,
|
||||
Cs(Option<i32>),
|
||||
}
|
||||
fn main() {
|
||||
match A::As<|> {
|
||||
A::As(_) => {}
|
||||
a @ A::Bs(_) => {}
|
||||
}
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
enum A {
|
||||
As,
|
||||
Bs,
|
||||
Cs(Option<i32>),
|
||||
}
|
||||
fn main() {
|
||||
match A::As {
|
||||
A::As(_) => {}
|
||||
a @ A::Bs(_) => {}
|
||||
$0A::Cs(_) => {}
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fill_match_arms_empty_body() {
|
||||
check_assist(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue