mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
fill_match_arms bind pattern test
This commit is contained in:
parent
017331a53c
commit
34db4edb80
@ -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]
|
#[test]
|
||||||
fn fill_match_arms_empty_body() {
|
fn fill_match_arms_empty_body() {
|
||||||
check_assist(
|
check_assist(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user