| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 test_analyzer_supported_exclude() { | 125 test_analyzer_supported_exclude() { |
| 126 validate( | 126 validate( |
| 127 ''' | 127 ''' |
| 128 analyzer: | 128 analyzer: |
| 129 exclude: | 129 exclude: |
| 130 - test/_data/p4/lib/lib1.dart | 130 - test/_data/p4/lib/lib1.dart |
| 131 ''', | 131 ''', |
| 132 []); | 132 []); |
| 133 } | 133 } |
| 134 | 134 |
| 135 test_analyzer_supported_filter() { |
| 136 validate( |
| 137 ''' |
| 138 analyzer: |
| 139 errors: |
| 140 unused_local_variable: ignore |
| 141 ''', |
| 142 []); |
| 143 } |
| 144 |
| 135 test_analyzer_supported_strong_mode() { | 145 test_analyzer_supported_strong_mode() { |
| 136 validate( | 146 validate( |
| 137 ''' | 147 ''' |
| 138 analyzer: | 148 analyzer: |
| 139 strong-mode: true | 149 strong-mode: true |
| 140 ''', | 150 ''', |
| 141 []); | 151 []); |
| 142 } | 152 } |
| 143 | 153 |
| 144 test_analyzer_unsupported_option() { | 154 test_analyzer_unsupported_option() { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 169 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION]); | 179 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION]); |
| 170 } | 180 } |
| 171 | 181 |
| 172 void validate(String source, List<AnalysisOptionsErrorCode> expected) { | 182 void validate(String source, List<AnalysisOptionsErrorCode> expected) { |
| 173 var options = optionsProvider.getOptionsFromString(source); | 183 var options = optionsProvider.getOptionsFromString(source); |
| 174 var errors = validator.validate(options); | 184 var errors = validator.validate(options); |
| 175 expect(errors.map((AnalysisError e) => e.errorCode), | 185 expect(errors.map((AnalysisError e) => e.errorCode), |
| 176 unorderedEquals(expected)); | 186 unorderedEquals(expected)); |
| 177 } | 187 } |
| 178 } | 188 } |
| OLD | NEW |