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/context/context.dart'; | 10 import 'package:analyzer/src/context/context.dart'; |
11 import 'package:analyzer/src/generated/engine.dart'; | 11 import 'package:analyzer/src/generated/engine.dart'; |
12 import 'package:analyzer/src/generated/source.dart'; | 12 import 'package:analyzer/src/generated/source.dart'; |
13 import 'package:analyzer/src/task/options.dart' | 13 import 'package:analyzer/src/task/options.dart' |
14 show CONFIGURED_ERROR_PROCESSORS; | 14 show CONFIGURED_ERROR_PROCESSORS; |
15 import 'package:analyzer/src/task/options.dart'; | 15 import 'package:analyzer/src/task/options.dart'; |
16 import 'package:analyzer/task/general.dart'; | 16 import 'package:analyzer/task/general.dart'; |
17 import 'package:analyzer/task/model.dart'; | 17 import 'package:analyzer/task/model.dart'; |
18 import 'package:test/test.dart'; | 18 import 'package:test/test.dart'; |
19 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 19 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
20 import 'package:yaml/yaml.dart'; | 20 import 'package:yaml/yaml.dart'; |
21 | 21 |
22 import '../../generated/test_support.dart'; | 22 import '../../generated/test_support.dart'; |
23 import '../../utils.dart'; | |
24 import '../context/abstract_context.dart'; | 23 import '../context/abstract_context.dart'; |
25 | 24 |
26 main() { | 25 main() { |
27 initializeTestEnvironment(); | |
28 defineReflectiveSuite(() { | 26 defineReflectiveSuite(() { |
29 defineReflectiveTests(ContextConfigurationTest); | 27 defineReflectiveTests(ContextConfigurationTest); |
30 defineReflectiveTests(GenerateNewOptionsErrorsTaskTest); | 28 defineReflectiveTests(GenerateNewOptionsErrorsTaskTest); |
31 defineReflectiveTests(GenerateOldOptionsErrorsTaskTest); | 29 defineReflectiveTests(GenerateOldOptionsErrorsTaskTest); |
32 defineReflectiveTests(OptionsFileValidatorTest); | 30 defineReflectiveTests(OptionsFileValidatorTest); |
33 }); | 31 }); |
34 } | 32 } |
35 | 33 |
36 isInstanceOf isGenerateOptionsErrorsTask = | 34 isInstanceOf isGenerateOptionsErrorsTask = |
37 new isInstanceOf<GenerateOptionsErrorsTask>(); | 35 new isInstanceOf<GenerateOptionsErrorsTask>(); |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]); | 396 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]); |
399 } | 397 } |
400 | 398 |
401 void validate(String source, List<ErrorCode> expected) { | 399 void validate(String source, List<ErrorCode> expected) { |
402 var options = optionsProvider.getOptionsFromString(source); | 400 var options = optionsProvider.getOptionsFromString(source); |
403 var errors = validator.validate(options); | 401 var errors = validator.validate(options); |
404 expect(errors.map((AnalysisError e) => e.errorCode), | 402 expect(errors.map((AnalysisError e) => e.errorCode), |
405 unorderedEquals(expected)); | 403 unorderedEquals(expected)); |
406 } | 404 } |
407 } | 405 } |
OLD | NEW |