Index: pkg/analyzer/test/src/task/dart_test.dart |
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart |
index a60b87904eb30286fe28abe44e2a129192c021a7..ceec646a89b033d59f1494d597321433a1f6d69e 100644 |
--- a/pkg/analyzer/test/src/task/dart_test.dart |
+++ b/pkg/analyzer/test/src/task/dart_test.dart |
@@ -46,6 +46,7 @@ main() { |
runReflectiveTests(ComputeLibraryCycleTaskTest); |
runReflectiveTests(ContainingLibrariesTaskTest); |
runReflectiveTests(DartErrorsTaskTest); |
+ runReflectiveTests(ErrorFilterTest); |
runReflectiveTests(EvaluateUnitConstantsTaskTest); |
runReflectiveTests(GatherUsedImportedElementsTaskTest); |
runReflectiveTests(GatherUsedLocalElementsTaskTest); |
@@ -2240,6 +2241,30 @@ f(A a) { |
} |
@reflectiveTest |
+class ErrorFilterTest extends _AbstractDartTaskTest { |
+ @override |
+ setUp() { |
+ super.setUp(); |
+ context.setConfigurationData(CONFIGURED_ERROR_FILTERS, [ |
+ (AnalysisError error) => error.errorCode.name == 'INVALID_ASSIGNMENT' |
+ ]); |
+ } |
+ |
+ test_error_filters() { |
+ AnalysisTarget library = newSource('/test.dart', ''' |
+main() { |
+ int x = ""; // INVALID_ASSIGNMENT (suppressed) |
+ // UNUSED_LOCAL_VARIABLE |
+}'''); |
+ computeResult(library, DART_ERRORS, matcher: isDartErrorsTask); |
+ expect(outputs, hasLength(1)); |
+ List<AnalysisError> errors = outputs[DART_ERRORS]; |
+ expect(errors, hasLength(1)); |
+ expect(errors.first.errorCode, HintCode.UNUSED_LOCAL_VARIABLE); |
+ } |
+} |
+ |
+@reflectiveTest |
class GenerateLintsTaskTest extends _AbstractDartTaskTest { |
void enableLints() { |
AnalysisOptionsImpl options = context.analysisOptions; |