Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: pkg/analyzer/test/src/task/options_test.dart

Issue 1418333002: OptionsValidator plugin extension and linter service. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Review feedback. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/task/options.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698