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

Unified Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1420363005: Error Suppression FTW. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Test fix. Created 5 years, 2 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/analyzer/test/src/context/context_test.dart ('k') | pkg/analyzer/test/src/task/options_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « pkg/analyzer/test/src/context/context_test.dart ('k') | pkg/analyzer/test/src/task/options_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698