mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
chore: add unapplicable test for extract_variable without select
This commit is contained in:
parent
00cdbe6c96
commit
7186a28717
@ -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]
|
#[test]
|
||||||
fn test_extract_var_simple() {
|
fn test_extract_var_simple() {
|
||||||
check_assist(
|
check_assist(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user