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

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

Issue 991133003: Quick Fix for using similarly named field/getter/setter instead of undefined. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 4608f6bd7520e5829a91554aae5ed2c2e35684f3..9fa1a7c2624164f9eac24cb9b484c5e39f2079fe 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -2709,6 +2709,63 @@ main() {
''');
}
+ void test_undefinedGetter_useSimilar_qualified() {
+ resolveTestUnit('''
+class A {
+ int myField;
+}
+main(A a) {
+ print(a.myFild);
+}
+''');
+ assertHasFix(FixKind.CHANGE_TO, '''
+class A {
+ int myField;
+}
+main(A a) {
+ print(a.myField);
+}
+''');
+ }
+
+ void test_undefinedGetter_useSimilar_qualified_static() {
+ resolveTestUnit('''
+class A {
+ static int MY_NAME = 1;
+}
+main() {
+ A.MY_NAM;
+}
+''');
+ assertHasFix(FixKind.CHANGE_TO, '''
+class A {
+ static int MY_NAME = 1;
+}
+main() {
+ A.MY_NAME;
+}
+''');
+ }
+
+ void test_undefinedGetter_useSimilar_unqualified() {
+ resolveTestUnit('''
+class A {
+ int myField;
+ main() {
+ print(myFild);
+ }
+}
+''');
+ assertHasFix(FixKind.CHANGE_TO, '''
+class A {
+ int myField;
+ main() {
+ print(myField);
+ }
+}
+''');
+ }
+
void test_undefinedMethod_create_BAD_inSDK() {
resolveTestUnit('''
main() {
@@ -3075,6 +3132,25 @@ class A {
''');
}
+ void test_undefinedSetter_useSimilar_unqualified() {
+ resolveTestUnit('''
+class A {
+ int myField;
+ main() {
+ myFild = 42;
+ }
+}
+''');
+ assertHasFix(FixKind.CHANGE_TO, '''
+class A {
+ int myField;
+ main() {
+ myField = 42;
+ }
+}
+''');
+ }
+
void test_useEffectiveIntegerDivision() {
resolveTestUnit('''
main() {
« 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