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 | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/crates/ide-assists/src/tests/generated.rs b/crates/ide-assists/src/tests/generated.rs index 69ea200db1..87c3d166ee 100644 --- a/crates/ide-assists/src/tests/generated.rs +++ b/crates/ide-assists/src/tests/generated.rs @@ -933,6 +933,24 @@ enum TheEnum { } #[test] +fn doctest_extract_constant() { + check_doc_test( + "extract_constant", + r#####" +fn main() { + $0(1 + 2)$0 * 4; +} +"#####, + r#####" +fn main() { + const $0VAR_NAME: i32 = 1 + 2; + VAR_NAME * 4; +} +"#####, + ) +} + +#[test] fn doctest_extract_expressions_from_format_string() { check_doc_test( "extract_expressions_from_format_string", @@ -1007,6 +1025,24 @@ fn bar(name: i32) -> i32 { } #[test] +fn doctest_extract_static() { + check_doc_test( + "extract_static", + r#####" +fn main() { + $0(1 + 2)$0 * 4; +} +"#####, + r#####" +fn main() { + static $0VAR_NAME: i32 = 1 + 2; + VAR_NAME * 4; +} +"#####, + ) +} + +#[test] fn doctest_extract_struct_from_enum_variant() { check_doc_test( "extract_struct_from_enum_variant", |