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

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

Issue 1412573012: Option support for `enableGenericMethods`. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge 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/test/generated/engine_test.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' hide AnalysisContextImpl; 9 import 'package:analyzer/src/generated/engine.dart' hide AnalysisContextImpl;
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
(...skipping 23 matching lines...) Expand all
34 final AnalysisOptionsProvider optionsProvider = new AnalysisOptionsProvider(); 34 final AnalysisOptionsProvider optionsProvider = new AnalysisOptionsProvider();
35 35
36 AnalysisOptions get analysisOptions => context.analysisOptions; 36 AnalysisOptions get analysisOptions => context.analysisOptions;
37 37
38 configureContext(String optionsSource) => 38 configureContext(String optionsSource) =>
39 configureContextOptions(context, parseOptions(optionsSource)); 39 configureContextOptions(context, parseOptions(optionsSource));
40 40
41 Map<String, YamlNode> parseOptions(String source) => 41 Map<String, YamlNode> parseOptions(String source) =>
42 optionsProvider.getOptionsFromString(source); 42 optionsProvider.getOptionsFromString(source);
43 43
44 test_configure_enableGenericMethods() {
45 expect(analysisOptions.enableGenericMethods, false);
46 configureContext('''
47 analyzer:
48 language:
49 enableGenericMethods: true
50 ''');
51 expect(analysisOptions.enableGenericMethods, true);
52 }
53
44 test_configure_enableSuperMixins() { 54 test_configure_enableSuperMixins() {
45 configureContext(''' 55 configureContext('''
46 analyzer: 56 analyzer:
47 language: 57 language:
48 enableSuperMixins: true 58 enableSuperMixins: true
49 '''); 59 ''');
50 expect(analysisOptions.enableSuperMixins, true); 60 expect(analysisOptions.enableSuperMixins, true);
51 } 61 }
52 62
53 test_configure_error_filters() { 63 test_configure_error_filters() {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 []); 248 []);
239 } 249 }
240 250
241 test_analyzer_language_unsupported_key() { 251 test_analyzer_language_unsupported_key() {
242 validate( 252 validate(
243 ''' 253 '''
244 analyzer: 254 analyzer:
245 language: 255 language:
246 unsupported: true 256 unsupported: true
247 ''', 257 ''',
248 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]); 258 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES]);
249 } 259 }
250 260
251 test_analyzer_language_unsupported_value() { 261 test_analyzer_language_unsupported_value() {
252 validate( 262 validate(
253 ''' 263 '''
254 analyzer: 264 analyzer:
255 language: 265 language:
256 enableSuperMixins: foo 266 enableSuperMixins: foo
257 ''', 267 ''',
258 [AnalysisOptionsWarningCode.UNSUPPORTED_VALUE]); 268 [AnalysisOptionsWarningCode.UNSUPPORTED_VALUE]);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]); 315 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]);
306 } 316 }
307 317
308 void validate(String source, List<AnalysisOptionsErrorCode> expected) { 318 void validate(String source, List<AnalysisOptionsErrorCode> expected) {
309 var options = optionsProvider.getOptionsFromString(source); 319 var options = optionsProvider.getOptionsFromString(source);
310 var errors = validator.validate(options); 320 var errors = validator.validate(options);
311 expect(errors.map((AnalysisError e) => e.errorCode), 321 expect(errors.map((AnalysisError e) => e.errorCode),
312 unorderedEquals(expected)); 322 unorderedEquals(expected));
313 } 323 }
314 } 324 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/engine_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698