Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_assists/src/tests/generated.rs')
| -rw-r--r-- | crates/ide_assists/src/tests/generated.rs | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/crates/ide_assists/src/tests/generated.rs b/crates/ide_assists/src/tests/generated.rs index 01db0162e3..252f375d85 100644 --- a/crates/ide_assists/src/tests/generated.rs +++ b/crates/ide_assists/src/tests/generated.rs @@ -122,6 +122,45 @@ struct Point<'a> { } #[test] +fn doctest_add_missing_match_arms() { + check_doc_test( + "add_missing_match_arms", + r#####" +enum Action { Move { distance: u32 }, Stop } + +fn handle(action: Action) { + match action { + $0 + } +} +"#####, + r#####" +enum Action { Move { distance: u32 }, Stop } + +fn handle(action: Action) { + match action { + $0Action::Move { distance } => todo!(), + Action::Stop => todo!(), + } +} +"#####, + ) +} + +#[test] +fn doctest_add_return_type() { + check_doc_test( + "add_return_type", + r#####" +fn foo() { 4$02i32 } +"#####, + r#####" +fn foo() -> i32 { 42i32 } +"#####, + ) +} + +#[test] fn doctest_add_turbo_fish() { check_doc_test( "add_turbo_fish", @@ -517,32 +556,6 @@ fn main() { } #[test] -fn doctest_fill_match_arms() { - check_doc_test( - "fill_match_arms", - r#####" -enum Action { Move { distance: u32 }, Stop } - -fn handle(action: Action) { - match action { - $0 - } -} -"#####, - r#####" -enum Action { Move { distance: u32 }, Stop } - -fn handle(action: Action) { - match action { - $0Action::Move { distance } => todo!(), - Action::Stop => todo!(), - } -} -"#####, - ) -} - -#[test] fn doctest_fix_visibility() { check_doc_test( "fix_visibility", @@ -995,19 +1008,6 @@ impl Person { } #[test] -fn doctest_infer_function_return_type() { - check_doc_test( - "infer_function_return_type", - r#####" -fn foo() { 4$02i32 } -"#####, - r#####" -fn foo() -> i32 { 42i32 } -"#####, - ) -} - -#[test] fn doctest_inline_call() { check_doc_test( "inline_call", @@ -1047,6 +1047,19 @@ fn main() { } #[test] +fn doctest_introduce_named_generic() { + check_doc_test( + "introduce_named_generic", + r#####" +fn foo(bar: $0impl Bar) {} +"#####, + r#####" +fn foo<B: Bar>(bar: B) {} +"#####, + ) +} + +#[test] fn doctest_introduce_named_lifetime() { check_doc_test( "introduce_named_lifetime", @@ -1529,19 +1542,6 @@ fn handle(action: Action) { } #[test] -fn doctest_replace_impl_trait_with_generic() { - check_doc_test( - "replace_impl_trait_with_generic", - r#####" -fn foo(bar: $0impl Bar) {} -"#####, - r#####" -fn foo<B: Bar>(bar: B) {} -"#####, - ) -} - -#[test] fn doctest_replace_let_with_if_let() { check_doc_test( "replace_let_with_if_let", |