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

Side by Side Diff: pkg/analyzer/test/src/task/options_test.dart

Issue 1541453002: Error code validation updates. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « pkg/analyzer/lib/src/task/options.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 analyzer.test.src.task.options_test; 5 library analyzer.test.src.task.options_test;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/source/analysis_options_provider.dart'; 8 import 'package:analyzer/source/analysis_options_provider.dart';
9 import 'package:analyzer/source/error_processor.dart'; 9 import 'package:analyzer/source/error_processor.dart';
10 import 'package:analyzer/src/generated/engine.dart'; 10 import 'package:analyzer/src/generated/engine.dart';
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 final OptionsFileValidator validator = 230 final OptionsFileValidator validator =
231 new OptionsFileValidator(new TestSource()); 231 new OptionsFileValidator(new TestSource());
232 final AnalysisOptionsProvider optionsProvider = new AnalysisOptionsProvider(); 232 final AnalysisOptionsProvider optionsProvider = new AnalysisOptionsProvider();
233 233
234 test_analyzer_error_code_supported() { 234 test_analyzer_error_code_supported() {
235 validate( 235 validate(
236 ''' 236 '''
237 analyzer: 237 analyzer:
238 errors: 238 errors:
239 unused_local_variable: ignore 239 unused_local_variable: ignore
240 invalid_assignment: warning
241 missing_return: error
242 dead_code: info
240 ''', 243 ''',
241 []); 244 []);
242 } 245 }
243 246
244 test_analyzer_error_code_supported_bad_value() { 247 test_analyzer_error_code_supported_bad_value() {
245 validate( 248 validate(
246 ''' 249 '''
247 analyzer: 250 analyzer:
248 errors: 251 errors:
249 unused_local_variable: ftw 252 unused_local_variable: ftw
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]); 360 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]);
358 } 361 }
359 362
360 void validate(String source, List<AnalysisOptionsErrorCode> expected) { 363 void validate(String source, List<AnalysisOptionsErrorCode> expected) {
361 var options = optionsProvider.getOptionsFromString(source); 364 var options = optionsProvider.getOptionsFromString(source);
362 var errors = validator.validate(options); 365 var errors = validator.validate(options);
363 expect(errors.map((AnalysisError e) => e.errorCode), 366 expect(errors.map((AnalysisError e) => e.errorCode),
364 unorderedEquals(expected)); 367 unorderedEquals(expected));
365 } 368 }
366 } 369 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698