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

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

Issue 1501633003: Strong-mode error code validation "enum" (#25117). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: cleanup 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/strong/info.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 test.src.task.options_test; 5 library 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/src/generated/engine.dart' hide AnalysisContextImpl; 9 import 'package:analyzer/src/generated/engine.dart' hide AnalysisContextImpl;
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 test_analyzer_language_unsupported_value() { 277 test_analyzer_language_unsupported_value() {
278 validate( 278 validate(
279 ''' 279 '''
280 analyzer: 280 analyzer:
281 language: 281 language:
282 enableSuperMixins: foo 282 enableSuperMixins: foo
283 ''', 283 ''',
284 [AnalysisOptionsWarningCode.UNSUPPORTED_VALUE]); 284 [AnalysisOptionsWarningCode.UNSUPPORTED_VALUE]);
285 } 285 }
286 286
287 test_analyzer_strong_mode_error_code_supported() {
288 validate(
289 '''
290 analyzer:
291 errors:
292 strong_mode_assignment_cast: ignore
293 ''',
294 []);
295 }
296
287 test_analyzer_supported_exclude() { 297 test_analyzer_supported_exclude() {
288 validate( 298 validate(
289 ''' 299 '''
290 analyzer: 300 analyzer:
291 exclude: 301 exclude:
292 - test/_data/p4/lib/lib1.dart 302 - test/_data/p4/lib/lib1.dart
293 ''', 303 ''',
294 []); 304 []);
295 } 305 }
296 306
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]); 350 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]);
341 } 351 }
342 352
343 void validate(String source, List<AnalysisOptionsErrorCode> expected) { 353 void validate(String source, List<AnalysisOptionsErrorCode> expected) {
344 var options = optionsProvider.getOptionsFromString(source); 354 var options = optionsProvider.getOptionsFromString(source);
345 var errors = validator.validate(options); 355 var errors = validator.validate(options);
346 expect(errors.map((AnalysisError e) => e.errorCode), 356 expect(errors.map((AnalysisError e) => e.errorCode),
347 unorderedEquals(expected)); 357 unorderedEquals(expected));
348 } 358 }
349 } 359 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/info.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698