Skip to content

Commit

Permalink
chore: add unapplicable test for extract_variable without select
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Flash committed Oct 28, 2023
1 parent 00cdbe6 commit 7186a28
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions crates/ide-assists/src/handlers/extract_variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,32 @@ fn main() {
);
}

#[test]
fn test_extract_var_unit_expr_without_select_not_applicable() {
check_assist_not_applicable(
extract_variable,
r#"
fn foo() {}
fn main() {
foo()$0;
}
"#,
);

check_assist_not_applicable(
extract_variable,
r#"
fn foo() {
let mut i = 3;
if i >= 0 {
i += 1;
} else {
i -= 1;
}$0
}"#,
);
}

#[test]
fn test_extract_var_simple() {
check_assist(
Expand Down

0 comments on commit 7186a28

Please sign in to comment.