| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |