aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_assists/src/tests')
-rw-r--r--crates/ide_assists/src/tests/generated.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/ide_assists/src/tests/generated.rs b/crates/ide_assists/src/tests/generated.rs
index 39f48dd76..14b372c62 100644
--- a/crates/ide_assists/src/tests/generated.rs
+++ b/crates/ide_assists/src/tests/generated.rs
@@ -483,6 +483,35 @@ struct Point {
483} 483}
484 484
485#[test] 485#[test]
486fn doctest_generate_enum_as_method() {
487 check_doc_test(
488 "generate_enum_as_method",
489 r#####"
490enum Value {
491 Number(i32),
492 Text(String)$0,
493}
494"#####,
495 r#####"
496enum Value {
497 Number(i32),
498 Text(String),
499}
500
501impl Value {
502 fn as_text(&self) -> Option<&String> {
503 if let Self::Text(v) = self {
504 Some(v)
505 } else {
506 None
507 }
508 }
509}
510"#####,
511 )
512}
513
514#[test]
486fn doctest_generate_enum_into_method() { 515fn doctest_generate_enum_into_method() {
487 check_doc_test( 516 check_doc_test(
488 "generate_enum_into_method", 517 "generate_enum_into_method",