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'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
10 import 'package:analyzer/src/generated/source.dart'; | 10 import 'package:analyzer/src/generated/source.dart'; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 test_linter_supported_rules() { | 148 test_linter_supported_rules() { |
149 validate( | 149 validate( |
150 ''' | 150 ''' |
151 linter: | 151 linter: |
152 rules: | 152 rules: |
153 - camel_case_types | 153 - camel_case_types |
154 ''', | 154 ''', |
155 []); | 155 []); |
156 } | 156 } |
157 | 157 |
158 test_linter_unssupported_option() { | 158 test_linter_unsupported_option() { |
159 validate( | 159 validate( |
160 ''' | 160 ''' |
161 linter: | 161 linter: |
162 unsupported: true | 162 unsupported: true |
163 ''', | 163 ''', |
164 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION]); | 164 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION]); |
165 } | 165 } |
166 | 166 |
167 void validate(String source, List<AnalysisOptionsErrorCode> expected) { | 167 void validate(String source, List<AnalysisOptionsErrorCode> expected) { |
168 var options = optionsProvider.getOptionsFromString(source); | 168 var options = optionsProvider.getOptionsFromString(source); |
169 var errors = validator.validate(options); | 169 var errors = validator.validate(options); |
170 expect(errors.map((AnalysisError e) => e.errorCode), | 170 expect(errors.map((AnalysisError e) => e.errorCode), |
171 unorderedEquals(expected)); | 171 unorderedEquals(expected)); |
172 } | 172 } |
173 } | 173 } |
OLD | NEW |