| 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 cc1f3ff50bc7048d94390adbba20f9a7714bc2bc..9d385404582e66e3c558d0b4be8bc470ad0e4b10 100644
|
| --- a/pkg/analysis_server/test/services/correction/fix_test.dart
|
| +++ b/pkg/analysis_server/test/services/correction/fix_test.dart
|
| @@ -5576,6 +5576,23 @@ void function({@required String param}) {
|
| ''');
|
| }
|
|
|
| + test_isNotEmpty() async {
|
| + String src = '''
|
| +f(c) {
|
| + if (/*LINT*/!c.isEmpty) {}
|
| +}
|
| +''';
|
| + await findLint(src, LintNames.prefer_is_not_empty);
|
| +
|
| + await applyFix(DartFixKind.USE_IS_NOT_EMPTY);
|
| +
|
| + verifyResult('''
|
| +f(c) {
|
| + if (c.isNotEmpty) {}
|
| +}
|
| +''');
|
| + }
|
| +
|
| test_lint_addMissingOverride_field() async {
|
| String src = '''
|
| class abstract Test {
|
| @@ -6108,7 +6125,7 @@ class A {
|
| ''');
|
| }
|
|
|
| - test_removeTypeName_avoidAnnotatingWithDynamic_InsideFunctionTypedFormalParameter() async {
|
| + test_removeTypeAnnotation_avoidAnnotatingWithDynamic_InsideFunctionTypedFormalParameter() async {
|
| String src = '''
|
| bad(void foo(/*LINT*/dynamic x)) {
|
| return null;
|
| @@ -6125,7 +6142,7 @@ bad(void foo(x)) {
|
| ''');
|
| }
|
|
|
| - test_removeTypeName_avoidAnnotatingWithDynamic_NamedParameter() async {
|
| + test_removeTypeAnnotation_avoidAnnotatingWithDynamic_NamedParameter() async {
|
| String src = '''
|
| bad({/*LINT*/dynamic defaultValue}) {
|
| return null;
|
| @@ -6142,7 +6159,7 @@ bad({defaultValue}) {
|
| ''');
|
| }
|
|
|
| - test_removeTypeName_avoidAnnotatingWithDynamic_NormalParameter() async {
|
| + test_removeTypeAnnotation_avoidAnnotatingWithDynamic_NormalParameter() async {
|
| String src = '''
|
| bad(/*LINT*/dynamic defaultValue) {
|
| return null;
|
| @@ -6159,7 +6176,7 @@ bad(defaultValue) {
|
| ''');
|
| }
|
|
|
| - test_removeTypeName_avoidAnnotatingWithDynamic_OptionalParameter() async {
|
| + test_removeTypeAnnotation_avoidAnnotatingWithDynamic_OptionalParameter() async {
|
| String src = '''
|
| bad([/*LINT*/dynamic defaultValue]) {
|
| return null;
|
| @@ -6176,7 +6193,7 @@ bad([defaultValue]) {
|
| ''');
|
| }
|
|
|
| - test_removeTypeName_avoidReturnTypesOnSetters_void() async {
|
| + test_removeTypeAnnotation_avoidReturnTypesOnSetters_void() async {
|
| String src = '''
|
| /*LINT*/void set speed2(int ms) {}
|
| ''';
|
| @@ -6189,7 +6206,7 @@ set speed2(int ms) {}
|
| ''');
|
| }
|
|
|
| - test_removeTypeName_avoidTypesOnClosureParameters_FunctionTypedFormalParameter() async {
|
| + test_removeTypeAnnotation_avoidTypesOnClosureParameters_FunctionTypedFormalParameter() async {
|
| String src = '''
|
| var functionWithFunction = (/*LINT*/int f(int x)) => f(0);
|
| ''';
|
| @@ -6202,7 +6219,7 @@ var functionWithFunction = (f) => f(0);
|
| ''');
|
| }
|
|
|
| - test_removeTypeName_avoidTypesOnClosureParameters_NamedParameter() async {
|
| + test_removeTypeAnnotation_avoidTypesOnClosureParameters_NamedParameter() async {
|
| String src = '''
|
| var x = ({/*LINT*/Future<int> defaultValue}) {
|
| return null;
|
| @@ -6219,7 +6236,7 @@ var x = ({defaultValue}) {
|
| ''');
|
| }
|
|
|
| - test_removeTypeName_avoidTypesOnClosureParameters_NormalParameter() async {
|
| + test_removeTypeAnnotation_avoidTypesOnClosureParameters_NormalParameter() async {
|
| String src = '''
|
| var x = (/*LINT*/Future<int> defaultValue) {
|
| return null;
|
| @@ -6236,7 +6253,7 @@ var x = (defaultValue) {
|
| ''');
|
| }
|
|
|
| - test_removeTypeName_avoidTypesOnClosureParameters_OptionalParameter() async {
|
| + test_removeTypeAnnotation_avoidTypesOnClosureParameters_OptionalParameter() async {
|
| String src = '''
|
| var x = ([/*LINT*/Future<int> defaultValue]) {
|
| return null;
|
| @@ -6253,6 +6270,25 @@ var x = ([defaultValue]) {
|
| ''');
|
| }
|
|
|
| + test_removeTypeAnnotation_typeInitFormals_void() async {
|
| + String src = '''
|
| +class C {
|
| + int f;
|
| + C(/*LINT*/int this.f);
|
| +}
|
| +''';
|
| + await findLint(src, LintNames.type_init_formals);
|
| +
|
| + await applyFix(DartFixKind.REMOVE_TYPE_NAME);
|
| +
|
| + verifyResult('''
|
| +class C {
|
| + int f;
|
| + C(this.f);
|
| +}
|
| +''');
|
| + }
|
| +
|
| test_replaceWithConditionalAssignment_withCodeBeforeAndAfter() async {
|
| String src = '''
|
| class Person {
|
|
|