aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/diagnostics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/diagnostics.rs')
-rw-r--r--crates/ra_ide/src/diagnostics.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs
index a52f7fdd9..a10e642db 100644
--- a/crates/ra_ide/src/diagnostics.rs
+++ b/crates/ra_ide/src/diagnostics.rs
@@ -473,6 +473,33 @@ mod tests {
473 } 473 }
474 474
475 #[test] 475 #[test]
476 fn test_fill_struct_fields_self() {
477 let before = r"
478 struct TestStruct {
479 one: i32,
480 }
481
482 impl TestStruct {
483 fn test_fn() {
484 let s = Self {};
485 }
486 }
487 ";
488 let after = r"
489 struct TestStruct {
490 one: i32,
491 }
492
493 impl TestStruct {
494 fn test_fn() {
495 let s = Self { one: ()};
496 }
497 }
498 ";
499 check_apply_diagnostic_fix(before, after);
500 }
501
502 #[test]
476 fn test_fill_struct_fields_enum() { 503 fn test_fill_struct_fields_enum() {
477 let before = r" 504 let before = r"
478 enum Expr { 505 enum Expr {