Index: pkg/analyzer/test/src/task/options_test.dart |
diff --git a/pkg/analyzer/test/src/task/options_test.dart b/pkg/analyzer/test/src/task/options_test.dart |
index 01ece33608643fadae7691a6e386fc36020cf415..98e022b5bbbaab73273ddd6db4bd148d6e4df5fd 100644 |
--- a/pkg/analyzer/test/src/task/options_test.dart |
+++ b/pkg/analyzer/test/src/task/options_test.dart |
@@ -143,18 +143,23 @@ analyzer: |
@reflectiveTest |
class GenerateNewOptionsErrorsTaskTest extends GenerateOptionsErrorsTaskTest { |
+ bool get isOptionsFileDeprecated => false; |
String get optionsFilePath => '/${AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE}'; |
} |
@reflectiveTest |
class GenerateOldOptionsErrorsTaskTest extends GenerateOptionsErrorsTaskTest { |
+ bool get isOptionsFileDeprecated => true; |
String get optionsFilePath => '/${AnalysisEngine.ANALYSIS_OPTIONS_FILE}'; |
} |
abstract class GenerateOptionsErrorsTaskTest extends AbstractContextTest { |
Source source; |
+ bool get isOptionsFileDeprecated; |
+ |
String get optionsFilePath; |
+ |
LineInfo lineInfo(String source) => |
GenerateOptionsErrorsTask.computeLineInfo(source); |
@@ -211,6 +216,29 @@ abstract class GenerateOptionsErrorsTaskTest extends AbstractContextTest { |
expect(descriptor, isNotNull); |
} |
+ @override |
+ void computeResult(AnalysisTarget target, ResultDescriptor result, |
+ {isInstanceOf matcher: null}) { |
+ super.computeResult(target, result, matcher: matcher); |
+ if (isOptionsFileDeprecated) { |
+ bool found = false; |
+ var errors = outputs[ANALYSIS_OPTIONS_ERRORS] as List<dynamic>; |
+ for (var error in errors) { |
+ if (error is AnalysisError && |
+ error.errorCode == |
+ AnalysisOptionsWarningCode |
+ .DEPRECATED_ANALYSIS_OPTIONS_FILE_NAME) { |
+ errors.remove(error); |
+ found = true; |
+ break; |
+ } |
+ } |
+ if (!found) { |
+ fail('Expected deprecated analysis options file name warning'); |
+ } |
+ } |
+ } |
+ |
test_perform_bad_yaml() { |
String code = r''' |
: |