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

Side by Side Diff: pkg/analysis_server/test/analysis/notification_analysis_options_test.dart

Issue 1410553005: Introducing a lint server plugin. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.analysis.notification.analysis_options; 5 library test.analysis.notification.analysis_options;
6 6
7 import 'package:analysis_server/plugin/protocol/protocol.dart'; 7 import 'package:analysis_server/plugin/protocol/protocol.dart';
8 import 'package:analysis_server/src/constants.dart'; 8 import 'package:analysis_server/src/constants.dart';
9 import 'package:analysis_server/src/domain_analysis.dart'; 9 import 'package:analysis_server/src/domain_analysis.dart';
10 import 'package:analyzer/src/generated/engine.dart'; 10 import 'package:analyzer/src/generated/engine.dart';
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 rules: 106 rules:
107 - camel_case_types 107 - camel_case_types
108 '''); 108 ''');
109 109
110 await pumpEventQueue(); 110 await pumpEventQueue();
111 await waitForTasksFinished(); 111 await waitForTasksFinished();
112 112
113 verifyLintsEnabled(['camel_case_types']); 113 verifyLintsEnabled(['camel_case_types']);
114 } 114 }
115 115
116 test_lint_options_unsupported() async {
117 addOptionsFile('''
118 linter:
119 rules:
120 - unsupported
121 ''');
122
123 addTestFile(testSource);
124 setAnalysisRoot();
125
126 await waitForTasksFinished();
127
128 expect(optionsFileErrors, hasLength(1));
129 expect(optionsFileErrors.first.severity, AnalysisErrorSeverity.WARNING);
130 expect(optionsFileErrors.first.type, AnalysisErrorType.STATIC_WARNING);
131 }
132
116 test_options_file_added() async { 133 test_options_file_added() async {
117 addTestFile(testSource); 134 addTestFile(testSource);
118 setAnalysisRoot(); 135 setAnalysisRoot();
119 136
120 await waitForTasksFinished(); 137 await waitForTasksFinished();
121 138
122 // Verify strong-mode disabled. 139 // Verify strong-mode disabled.
123 verifyStrongMode(enabled: false); 140 verifyStrongMode(enabled: false);
124 141
125 // Clear errors. 142 // Clear errors.
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 AnalysisErrorType.STATIC_TYPE_WARNING, 224 AnalysisErrorType.STATIC_TYPE_WARNING,
208 AnalysisErrorType.COMPILE_TIME_ERROR 225 AnalysisErrorType.COMPILE_TIME_ERROR
209 ])); 226 ]));
210 } else { 227 } else {
211 // Should only produce a hint. 228 // Should only produce a hint.
212 expect(errors.map((error) => error.type), 229 expect(errors.map((error) => error.type),
213 unorderedEquals([AnalysisErrorType.HINT])); 230 unorderedEquals([AnalysisErrorType.HINT]));
214 } 231 }
215 } 232 }
216 } 233 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/server/driver.dart ('k') | pkg/analysis_server/test/analysis_abstract.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698