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

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

Issue 2361483002: Issue 27386. Fix for 'use similar' Quick Fix for import-prefixed identifiers. (Closed)
Patch Set: Created 4 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 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() {}
« 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