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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 test_analyzer_supported_exclude() { | 140 test_analyzer_supported_exclude() { |
141 validate( | 141 validate( |
142 ''' | 142 ''' |
143 analyzer: | 143 analyzer: |
144 exclude: | 144 exclude: |
145 - test/_data/p4/lib/lib1.dart | 145 - test/_data/p4/lib/lib1.dart |
146 ''', | 146 ''', |
147 []); | 147 []); |
148 } | 148 } |
149 | 149 |
| 150 test_analyzer_supported_filter() { |
| 151 validate( |
| 152 ''' |
| 153 analyzer: |
| 154 errors: |
| 155 unused_local_variable: ignore |
| 156 ''', |
| 157 []); |
| 158 } |
| 159 |
150 test_analyzer_supported_strong_mode() { | 160 test_analyzer_supported_strong_mode() { |
151 validate( | 161 validate( |
152 ''' | 162 ''' |
153 analyzer: | 163 analyzer: |
154 strong-mode: true | 164 strong-mode: true |
155 ''', | 165 ''', |
156 []); | 166 []); |
157 } | 167 } |
158 | 168 |
159 test_analyzer_unsupported_option() { | 169 test_analyzer_unsupported_option() { |
(...skipping 24 matching lines...) Expand all Loading... |
184 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION]); | 194 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION]); |
185 } | 195 } |
186 | 196 |
187 void validate(String source, List<AnalysisOptionsErrorCode> expected) { | 197 void validate(String source, List<AnalysisOptionsErrorCode> expected) { |
188 var options = optionsProvider.getOptionsFromString(source); | 198 var options = optionsProvider.getOptionsFromString(source); |
189 var errors = validator.validate(options); | 199 var errors = validator.validate(options); |
190 expect(errors.map((AnalysisError e) => e.errorCode), | 200 expect(errors.map((AnalysisError e) => e.errorCode), |
191 unorderedEquals(expected)); | 201 unorderedEquals(expected)); |
192 } | 202 } |
193 } | 203 } |
OLD | NEW |