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 60897d94f81436aebae6b50fa22ea3b6b52a3358..9bc4a4f4bc8bf7ee168990b0715d659c8711ebdc 100644 |
--- a/pkg/analysis_server/test/services/correction/fix_test.dart |
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart |
@@ -3971,6 +3971,23 @@ const a = const A(); |
'''); |
} |
+ test_undefinedClass_useSimilar_BAD_prefixed() async { |
+ resolveTestUnit(''' |
+import 'dart:async' as c; |
+main() { |
+ c.Fture v = null; |
+} |
+'''); |
+ await assertHasFix( |
+ DartFixKind.CHANGE_TO, |
+ ''' |
+import 'dart:async' as c; |
+main() { |
+ c.Future v = null; |
+} |
+'''); |
+ } |
+ |
test_undefinedClass_useSimilar_fromImport() async { |
resolveTestUnit(''' |
main() { |
@@ -4370,6 +4387,33 @@ main() { |
'''); |
} |
+ test_undefinedFunction_useSimilar_prefixed_fromImport() async { |
+ resolveTestUnit(''' |
+import 'dart:core' as c; |
+main() { |
+ c.prnt(42); |
+} |
+'''); |
+ await assertHasFix( |
+ DartFixKind.CHANGE_TO, |
+ ''' |
+import 'dart:core' as c; |
+main() { |
+ c.print(42); |
+} |
+'''); |
+ } |
+ |
+ test_undefinedFunction_useSimilar_prefixed_ignoreLocal() async { |
+ resolveTestUnit(''' |
+import 'dart:async' as c; |
+main() { |
+ c.main(); |
+} |
+'''); |
+ await assertNoFix(DartFixKind.CHANGE_TO); |
+ } |
+ |
test_undefinedFunction_useSimilar_thisLibrary() async { |
resolveTestUnit(''' |
myFunction() {} |