Skip to content

Commit 34db4ed

Browse files
committed
fill_match_arms bind pattern test
1 parent 017331a commit 34db4ed

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

crates/ra_assists/src/handlers/fill_match_arms.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,40 @@ mod tests {
350350
);
351351
}
352352

353+
#[test]
354+
fn partial_fill_bind_pat() {
355+
check_assist(
356+
fill_match_arms,
357+
r#"
358+
enum A {
359+
As,
360+
Bs,
361+
Cs(Option<i32>),
362+
}
363+
fn main() {
364+
match A::As<|> {
365+
A::As(_) => {}
366+
a @ A::Bs(_) => {}
367+
}
368+
}
369+
"#,
370+
r#"
371+
enum A {
372+
As,
373+
Bs,
374+
Cs(Option<i32>),
375+
}
376+
fn main() {
377+
match A::As {
378+
A::As(_) => {}
379+
a @ A::Bs(_) => {}
380+
$0A::Cs(_) => {}
381+
}
382+
}
383+
"#,
384+
);
385+
}
386+
353387
#[test]
354388
fn fill_match_arms_empty_body() {
355389
check_assist(

0 commit comments

Comments
 (0)