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

Unified Diff: pkg/analysis_server/test/context_manager_test.dart

Issue 1414863004: Stop unwanted sharing between filter closures. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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/analysis_server/lib/src/context_manager.dart ('k') | pkg/analyzer/lib/src/task/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/context_manager_test.dart
diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart
index 42ff840de8d18f67ce4853396fc9326295a33773..0baa6fc079faf6effaeb53ab80b7fcedfbb32051 100644
--- a/pkg/analysis_server/test/context_manager_test.dart
+++ b/pkg/analysis_server/test/context_manager_test.dart
@@ -162,6 +162,40 @@ analyzer:
isTrue);
}
+ test_error_filter_analysis_option_multiple_filters() async {
+ // Create files.
+ newFile(
+ [projPath, AnalysisEngine.ANALYSIS_OPTIONS_FILE],
+ r'''
+analyzer:
+ errors:
+ invalid_assignment: ignore
+ unused_local_variable: ignore
+''');
+ // Setup context.
+ manager.setRoots(<String>[projPath], <String>[], <String, String>{});
+
+ // Verify filter setup.
+ List<ErrorFilter> filters =
+ callbacks.currentContext.getConfigurationData(CONFIGURED_ERROR_FILTERS);
+ expect(filters, isNotNull);
+ expect(filters, hasLength(2));
+
+ var unused_error = new AnalysisError(
+ new TestSource(), 0, 1, HintCode.UNUSED_LOCAL_VARIABLE, [
+ ['x']
+ ]);
+
+ var invalid_assignment_error =
+ new AnalysisError(new TestSource(), 0, 1, HintCode.INVALID_ASSIGNMENT, [
+ ['x'],
+ ['y']
+ ]);
+
+ expect(filters.any((filter) => filter(unused_error)), isTrue);
+ expect(filters.any((filter) => filter(invalid_assignment_error)), isTrue);
+ }
+
test_error_filter_analysis_option_synonyms() async {
// Create files.
newFile(
« no previous file with comments | « pkg/analysis_server/lib/src/context_manager.dart ('k') | pkg/analyzer/lib/src/task/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698