move test case

This commit is contained in:
k-nasa 2021-10-13 21:03:01 +09:00
parent a6a052f407
commit ef9c4b666f

View File

@ -574,6 +574,32 @@ fn main() {
)
}
#[test]
fn nested_type() {
check_assist(
replace_if_let_with_match,
r#"
//- minicore: result
fn foo(x: Result<i32, ()>) {
let bar: Result<_, ()> = Ok(Some(1));
$0if let Ok(Some(_)) = bar {
()
} else {
()
}
}
"#,
r#"
fn foo(x: Result<i32, ()>) {
let bar: Result<_, ()> = Ok(Some(1));
match bar {
Ok(Some(_)) => (),
_ => (),
}
"#,
);
}
#[test]
fn test_replace_match_with_if_let_unwraps_simple_expressions() {
check_assist(
@ -885,32 +911,6 @@ fn foo() {
Bar(bar) => println!("bar {}", bar),
}
}
"#,
);
}
#[test]
fn nested_type() {
check_assist(
replace_if_let_with_match,
r#"
//- minicore: result
fn foo(x: Result<i32, ()>) {
let bar: Result<_, ()> = Ok(Some(1));
$0if let Ok(Some(_)) = bar {
()
} else {
()
}
}
"#,
r#"
fn foo(x: Result<i32, ()>) {
let bar: Result<_, ()> = Ok(Some(1));
match bar {
Ok(Some(_)) => (),
_ => (),
}
"#,
);
}