| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 test_configure_enableGenericMethods() { | 70 test_configure_enableGenericMethods() { |
| 71 expect(analysisOptions.enableGenericMethods, false); | 71 expect(analysisOptions.enableGenericMethods, false); |
| 72 configureContext(''' | 72 configureContext(''' |
| 73 analyzer: | 73 analyzer: |
| 74 language: | 74 language: |
| 75 enableGenericMethods: true | 75 enableGenericMethods: true |
| 76 '''); | 76 '''); |
| 77 expect(analysisOptions.enableGenericMethods, true); | 77 expect(analysisOptions.enableGenericMethods, true); |
| 78 } | 78 } |
| 79 | 79 |
| 80 test_configure_enableConditionalDirectives() { |
| 81 expect(analysisOptions.enableConditionalDirectives, false); |
| 82 configureContext(''' |
| 83 analyzer: |
| 84 language: |
| 85 enableConditionalDirectives: true |
| 86 '''); |
| 87 expect(analysisOptions.enableConditionalDirectives, true); |
| 88 } |
| 89 |
| 80 test_configure_enableSuperMixins() { | 90 test_configure_enableSuperMixins() { |
| 81 configureContext(''' | 91 configureContext(''' |
| 82 analyzer: | 92 analyzer: |
| 83 language: | 93 language: |
| 84 enableSuperMixins: true | 94 enableSuperMixins: true |
| 85 '''); | 95 '''); |
| 86 expect(analysisOptions.enableSuperMixins, true); | 96 expect(analysisOptions.enableSuperMixins, true); |
| 87 } | 97 } |
| 88 | 98 |
| 89 test_configure_error_processors() { | 99 test_configure_error_processors() { |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]); | 387 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]); |
| 378 } | 388 } |
| 379 | 389 |
| 380 void validate(String source, List<AnalysisOptionsErrorCode> expected) { | 390 void validate(String source, List<AnalysisOptionsErrorCode> expected) { |
| 381 var options = optionsProvider.getOptionsFromString(source); | 391 var options = optionsProvider.getOptionsFromString(source); |
| 382 var errors = validator.validate(options); | 392 var errors = validator.validate(options); |
| 383 expect(errors.map((AnalysisError e) => e.errorCode), | 393 expect(errors.map((AnalysisError e) => e.errorCode), |
| 384 unorderedEquals(expected)); | 394 unorderedEquals(expected)); |
| 385 } | 395 } |
| 386 } | 396 } |
| OLD | NEW |