diff options
Diffstat (limited to 'crates/assists/src/tests/generated.rs')
-rw-r--r-- | crates/assists/src/tests/generated.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/crates/assists/src/tests/generated.rs b/crates/assists/src/tests/generated.rs index 8d50c8791..853bde09c 100644 --- a/crates/assists/src/tests/generated.rs +++ b/crates/assists/src/tests/generated.rs | |||
@@ -890,6 +890,34 @@ fn compute() -> Option<i32> { None } | |||
890 | } | 890 | } |
891 | 891 | ||
892 | #[test] | 892 | #[test] |
893 | fn doctest_replace_match_with_if_let() { | ||
894 | check_doc_test( | ||
895 | "replace_match_with_if_let", | ||
896 | r#####" | ||
897 | enum Action { Move { distance: u32 }, Stop } | ||
898 | |||
899 | fn handle(action: Action) { | ||
900 | <|>match action { | ||
901 | Action::Move { distance } => foo(distance), | ||
902 | _ => bar(), | ||
903 | } | ||
904 | } | ||
905 | "#####, | ||
906 | r#####" | ||
907 | enum Action { Move { distance: u32 }, Stop } | ||
908 | |||
909 | fn handle(action: Action) { | ||
910 | if let Action::Move { distance } = action { | ||
911 | foo(distance) | ||
912 | } else { | ||
913 | bar() | ||
914 | } | ||
915 | } | ||
916 | "#####, | ||
917 | ) | ||
918 | } | ||
919 | |||
920 | #[test] | ||
893 | fn doctest_replace_qualified_name_with_use() { | 921 | fn doctest_replace_qualified_name_with_use() { |
894 | check_doc_test( | 922 | check_doc_test( |
895 | "replace_qualified_name_with_use", | 923 | "replace_qualified_name_with_use", |