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

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

Issue 1413973007: Issue 24714. Check other libraries that define unresolved class. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 c42ed2d3a389d04c3fe3a091cc781badea7621a4..14f2fc8811e317029f828a76b90c4914250ce2df 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -5,7 +5,8 @@
library test.services.correction.fix;
import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
-import 'package:analysis_server/plugin/protocol/protocol.dart' hide AnalysisError;
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+ hide AnalysisError;
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/correction/fix_internal.dart';
import 'package:analyzer/file_system/file_system.dart';
@@ -1543,6 +1544,37 @@ main(A a) {
''');
}
+ void test_createGetter_location_afterLastGetter() {
+ resolveTestUnit('''
+class A {
+ int existingField;
+
+ int get existingGetter => null;
+
+ existingMethod() {}
+}
+main(A a) {
+ int v = a.test;
+}
+''');
+ assertHasFix(
+ DartFixKind.CREATE_GETTER,
+ '''
+class A {
+ int existingField;
+
+ int get existingGetter => null;
+
+ int get test => null;
+
+ existingMethod() {}
+}
+main(A a) {
+ int v = a.test;
+}
+''');
+ }
+
void test_createGetter_multiLevel() {
resolveTestUnit('''
class A {
@@ -2212,37 +2244,6 @@ class B extends A {
''');
}
- void test_creatGetter_location_afterLastGetter() {
- resolveTestUnit('''
-class A {
- int existingField;
-
- int get existingGetter => null;
-
- existingMethod() {}
-}
-main(A a) {
- int v = a.test;
-}
-''');
- assertHasFix(
- DartFixKind.CREATE_GETTER,
- '''
-class A {
- int existingField;
-
- int get existingGetter => null;
-
- int get test => null;
-
- existingMethod() {}
-}
-main(A a) {
- int v = a.test;
-}
-''');
- }
-
void test_creationFunction_forFunctionType_cascadeSecond() {
resolveTestUnit('''
class A {
@@ -2647,6 +2648,41 @@ main() {
''');
}
+ void test_importLibraryProject_withClass_hasOtherLibraryWithPrefix() {
+ testFile = '/project/bin/test.dart';
+ addSource(
+ '/project/bin/a.dart',
+ '''
+library a;
+class One {}
+''');
+ addSource(
+ '/project/bin/b.dart',
+ '''
+library b;
+class One {}
+class Two {}
+''');
+ resolveTestUnit('''
+import 'b.dart' show Two;
+main () {
+ new Two();
+ new One();
+}
+''');
+ performAllAnalysisTasks();
+ assertHasFix(
+ DartFixKind.IMPORT_LIBRARY_PROJECT,
+ '''
+import 'b.dart' show Two;
+import 'a.dart';
+main () {
+ new Two();
+ new One();
+}
+''');
+ }
+
void test_importLibraryProject_withClass_inParentFolder() {
testFile = '/project/bin/test.dart';
addSource(
« 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