Index: pkg/analysis_server/test/services/correction/fix_test.dart |
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart |
index 5244097290c6518adeacff56a2d9c881f6f79b62..5bde96667d304eec57c3c2bfd8981c18ac41ee2e 100644 |
--- a/pkg/analysis_server/test/services/correction/fix_test.dart |
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart |
@@ -1011,8 +1011,7 @@ main() { |
class A { |
int field; |
- A(int i, double d) { |
- } |
+ A(int i, double d); |
method() {} |
} |
@@ -1035,8 +1034,7 @@ main() { |
DartFixKind.CREATE_CONSTRUCTOR, |
''' |
class A { |
- A.named(int i, double d) { |
- } |
+ A.named(int i, double d); |
method() {} |
} |
@@ -1047,6 +1045,26 @@ main() { |
_assertLinkedGroup(change.linkedEditGroups[0], ['named(int ', 'named(1']); |
} |
+ test_createConstructor_named_emptyClassBody() async { |
+ resolveTestUnit(''' |
+class A {} |
+main() { |
+ new A.named(1); |
+} |
+'''); |
+ await assertHasFix( |
+ DartFixKind.CREATE_CONSTRUCTOR, |
+ ''' |
+class A { |
+ A.named(int i); |
+} |
+main() { |
+ new A.named(1); |
+} |
+'''); |
+ _assertLinkedGroup(change.linkedEditGroups[0], ['named(int ', 'named(1']); |
+ } |
+ |
test_createConstructorForFinalFields_inTopLevelMethod() async { |
resolveTestUnit(''' |
main() { |
@@ -2569,6 +2587,30 @@ class B extends A { |
} |
} |
+ test_createMissingOverrides_method_emptyClassBody() async { |
+ resolveTestUnit(''' |
+abstract class A { |
+ void foo(); |
+} |
+ |
+class B extends A {} |
+'''); |
+ await assertHasFix( |
+ DartFixKind.CREATE_MISSING_OVERRIDES, |
+ ''' |
+abstract class A { |
+ void foo(); |
+} |
+ |
+class B extends A { |
+ @override |
+ void foo() { |
+ // TODO: implement foo |
+ } |
+} |
+'''); |
+ } |
+ |
test_createMissingOverrides_operator() async { |
resolveTestUnit(''' |
abstract class A { |