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

Unified Diff: pkg/analyzer/test/source/error_processor_test.dart

Issue 2863013002: Fix an issue with configuring the severity of lints. (Closed)
Patch Set: update dartdoc Created 3 years, 7 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/lib/source/error_processor.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/source/error_processor_test.dart
diff --git a/pkg/analyzer/test/source/error_processor_test.dart b/pkg/analyzer/test/source/error_processor_test.dart
index c7f0852f1335d59d59b82f7ef25183814f4814c3..e55d91e05f7d48d8b4eecbd30296a63db0810b7a 100644
--- a/pkg/analyzer/test/source/error_processor_test.dart
+++ b/pkg/analyzer/test/source/error_processor_test.dart
@@ -45,6 +45,11 @@ main() {
['x']
]);
+ // We in-line a lint code here in order to avoid adding a dependency on the
+ // linter package.
+ AnalysisError annotate_overrides = new AnalysisError(
+ new TestSource(), 0, 1, new LintCode('annotate_overrides', ''));
+
oneTimeSetup();
setUp(() {
@@ -116,6 +121,7 @@ analyzer:
orElse: () => null);
expect(invalidAssignmentProcessor, isNull);
});
+
test('string map', () {
var options = {
'invalid_assignment': 'unsupported_action', // should be skipped
@@ -142,6 +148,18 @@ analyzer:
expect(invalidAssignmentProcessor, isNull);
});
});
+
+ test('configure lints', () {
+ var options = optionsProvider.getOptionsFromString(
+ 'analyzer:\n errors:\n annotate_overrides: warning\n');
+ var errorConfig =
+ new ErrorConfig((options['analyzer'] as YamlMap)['errors']);
+ expect(errorConfig.processors, hasLength(1));
+
+ ErrorProcessor processor = errorConfig.processors.first;
+ expect(processor.appliesTo(annotate_overrides), true);
+ expect(processor.severity, ErrorSeverity.WARNING);
+ });
});
}
« no previous file with comments | « pkg/analyzer/lib/source/error_processor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698