| 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 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 test_configure_enableSuperMixins() { | 90 test_configure_enableSuperMixins() { |
| 91 configureContext(''' | 91 configureContext(''' |
| 92 analyzer: | 92 analyzer: |
| 93 language: | 93 language: |
| 94 enableSuperMixins: true | 94 enableSuperMixins: true |
| 95 '''); | 95 '''); |
| 96 expect(analysisOptions.enableSuperMixins, true); | 96 expect(analysisOptions.enableSuperMixins, true); |
| 97 } | 97 } |
| 98 | 98 |
| 99 test_configure_enableStrictCallChecks() { |
| 100 configureContext(''' |
| 101 analyzer: |
| 102 language: |
| 103 enableStrictCallChecks: true |
| 104 '''); |
| 105 expect(analysisOptions.enableStrictCallChecks, true); |
| 106 } |
| 107 |
| 99 test_configure_error_processors() { | 108 test_configure_error_processors() { |
| 100 configureContext(''' | 109 configureContext(''' |
| 101 analyzer: | 110 analyzer: |
| 102 errors: | 111 errors: |
| 103 invalid_assignment: ignore | 112 invalid_assignment: ignore |
| 104 unused_local_variable: error | 113 unused_local_variable: error |
| 105 '''); | 114 '''); |
| 106 | 115 |
| 107 List<ErrorProcessor> processors = | 116 List<ErrorProcessor> processors = |
| 108 context.getConfigurationData(CONFIGURED_ERROR_PROCESSORS); | 117 context.getConfigurationData(CONFIGURED_ERROR_PROCESSORS); |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]); | 396 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]); |
| 388 } | 397 } |
| 389 | 398 |
| 390 void validate(String source, List<AnalysisOptionsErrorCode> expected) { | 399 void validate(String source, List<AnalysisOptionsErrorCode> expected) { |
| 391 var options = optionsProvider.getOptionsFromString(source); | 400 var options = optionsProvider.getOptionsFromString(source); |
| 392 var errors = validator.validate(options); | 401 var errors = validator.validate(options); |
| 393 expect(errors.map((AnalysisError e) => e.errorCode), | 402 expect(errors.map((AnalysisError e) => e.errorCode), |
| 394 unorderedEquals(expected)); | 403 unorderedEquals(expected)); |
| 395 } | 404 } |
| 396 } | 405 } |
| OLD | NEW |