Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Unified Diff: pkg/analysis_server/test/services/correction/fix_test.dart

Issue 563333002: Issue 19799. Merge getter/setter pairs into fields when create missing overrides. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak for number of generated elements. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0ed0b50a250d9cf52defe2713c1a9e32adfe011d..b1a00cd2a150b713d281e6643c785b859d438344 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -499,6 +499,37 @@ class B extends A {
''');
}
+ void test_createMissingOverrides_mergeToField_getterSetter() {
+ _indexTestUnit('''
+class A {
+ int ma;
+ void mb() {}
+ double mc;
+}
+
+class B implements A {
+}
+''');
+ assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+class A {
+ int ma;
+ void mb() {}
+ double mc;
+}
+
+class B implements A {
+ int ma;
+
+ double mc;
+
+ @override
+ void mb() {
+ // TODO: implement mb
+ }
+}
+''');
+ }
+
void test_createMissingOverrides_method() {
_indexTestUnit('''
abstract class A {
@@ -1278,20 +1309,6 @@ main() {
''');
}
- void test_replaceVarWithDynamic() {
- checkHasSingleError = false;
- _indexTestUnit('''
-class A {
- Map<String, var> m;
-}
-''');
- assertHasFix(FixKind.REPLACE_VAR_WITH_DYNAMIC, '''
-class A {
- Map<String, dynamic> m;
-}
-''');
- }
-
void test_replaceImportUri_inProject() {
testFile = '/project/bin/test.dart';
addSource('/project/foo/bar/lib.dart', '');
@@ -1315,6 +1332,20 @@ import 'package:my_pkg/my_lib.dart';
''');
}
+ void test_replaceVarWithDynamic() {
+ checkHasSingleError = false;
+ _indexTestUnit('''
+class A {
+ Map<String, var> m;
+}
+''');
+ assertHasFix(FixKind.REPLACE_VAR_WITH_DYNAMIC, '''
+class A {
+ Map<String, dynamic> m;
+}
+''');
+ }
+
void test_replaceWithConstInstanceCreation() {
_indexTestUnit('''
class A {
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698