| 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 5735dec83143043504d097f9bbee59e484117d8b..393c2f37b0d34688afd5fa82db7ea5014f94de0a 100644
|
| --- a/pkg/analysis_server/test/services/correction/fix_test.dart
|
| +++ b/pkg/analysis_server/test/services/correction/fix_test.dart
|
| @@ -541,6 +541,15 @@ class Test {
|
| _assertLinkedGroup(change.linkedEditGroups[0], ['Test v =', 'Test {']);
|
| }
|
|
|
| + void test_createClass_BAD_hasUnresolvedPrefix() {
|
| + resolveTestUnit('''
|
| +main() {
|
| + prefix.Test v = null;
|
| +}
|
| +''');
|
| + assertNoFix(DartFixKind.CREATE_CLASS);
|
| + }
|
| +
|
| void test_createClass_inLibraryOfPrefix() {
|
| String libCode = r'''
|
| library my.lib;
|
| @@ -2612,44 +2621,6 @@ main() {
|
| ''');
|
| }
|
|
|
| - void test_importLibraryPrefix_withClass() {
|
| - resolveTestUnit('''
|
| -import 'dart:async' as pref;
|
| -main() {
|
| - pref.Stream s = null;
|
| - Future f = null;
|
| -}
|
| -''');
|
| - assertHasFix(
|
| - DartFixKind.IMPORT_LIBRARY_PREFIX,
|
| - '''
|
| -import 'dart:async' as pref;
|
| -main() {
|
| - pref.Stream s = null;
|
| - pref.Future f = null;
|
| -}
|
| -''');
|
| - }
|
| -
|
| - void test_importLibraryPrefix_withTopLevelVariable() {
|
| - resolveTestUnit('''
|
| -import 'dart:math' as pref;
|
| -main() {
|
| - print(pref.E);
|
| - print(PI);
|
| -}
|
| -''');
|
| - assertHasFix(
|
| - DartFixKind.IMPORT_LIBRARY_PREFIX,
|
| - '''
|
| -import 'dart:math' as pref;
|
| -main() {
|
| - print(pref.E);
|
| - print(pref.PI);
|
| -}
|
| -''');
|
| - }
|
| -
|
| void test_importLibraryProject_withClass_annotation() {
|
| addSource(
|
| '/lib.dart',
|
| @@ -4364,6 +4335,44 @@ main() {
|
| ''');
|
| }
|
|
|
| + void test_useImportPrefix_withClass() {
|
| + resolveTestUnit('''
|
| +import 'dart:async' as pref;
|
| +main() {
|
| + pref.Stream s = null;
|
| + Future f = null;
|
| +}
|
| +''');
|
| + assertHasFix(
|
| + DartFixKind.IMPORT_LIBRARY_PREFIX,
|
| + '''
|
| +import 'dart:async' as pref;
|
| +main() {
|
| + pref.Stream s = null;
|
| + pref.Future f = null;
|
| +}
|
| +''');
|
| + }
|
| +
|
| + void test_useImportPrefix_withTopLevelVariable() {
|
| + resolveTestUnit('''
|
| +import 'dart:math' as pref;
|
| +main() {
|
| + print(pref.E);
|
| + print(PI);
|
| +}
|
| +''');
|
| + assertHasFix(
|
| + DartFixKind.IMPORT_LIBRARY_PREFIX,
|
| + '''
|
| +import 'dart:math' as pref;
|
| +main() {
|
| + print(pref.E);
|
| + print(pref.PI);
|
| +}
|
| +''');
|
| + }
|
| +
|
| /**
|
| * Computes fixes and verifies that there is a fix of the given kind.
|
| */
|
|
|