Skip to content

Commit 7186a28

Browse files
committed
chore: add unapplicable test for extract_variable without select
1 parent 00cdbe6 commit 7186a28

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

crates/ide-assists/src/handlers/extract_variable.rs

+26
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,32 @@ fn main() {
350350
);
351351
}
352352

353+
#[test]
354+
fn test_extract_var_unit_expr_without_select_not_applicable() {
355+
check_assist_not_applicable(
356+
extract_variable,
357+
r#"
358+
fn foo() {}
359+
fn main() {
360+
foo()$0;
361+
}
362+
"#,
363+
);
364+
365+
check_assist_not_applicable(
366+
extract_variable,
367+
r#"
368+
fn foo() {
369+
let mut i = 3;
370+
if i >= 0 {
371+
i += 1;
372+
} else {
373+
i -= 1;
374+
}$0
375+
}"#,
376+
);
377+
}
378+
353379
#[test]
354380
fn test_extract_var_simple() {
355381
check_assist(

0 commit comments

Comments
 (0)