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

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

Issue 1744773002: Support conditional directives in the options file. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months 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 analyzer.test.src.task.options_test; 5 library analyzer.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/source/error_processor.dart'; 9 import 'package:analyzer/source/error_processor.dart';
10 import 'package:analyzer/src/generated/engine.dart'; 10 import 'package:analyzer/src/generated/engine.dart';
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 test_configure_enableGenericMethods() { 70 test_configure_enableGenericMethods() {
71 expect(analysisOptions.enableGenericMethods, false); 71 expect(analysisOptions.enableGenericMethods, false);
72 configureContext(''' 72 configureContext('''
73 analyzer: 73 analyzer:
74 language: 74 language:
75 enableGenericMethods: true 75 enableGenericMethods: true
76 '''); 76 ''');
77 expect(analysisOptions.enableGenericMethods, true); 77 expect(analysisOptions.enableGenericMethods, true);
78 } 78 }
79 79
80 test_configure_enableConditionalDirectives() {
81 expect(analysisOptions.enableConditionalDirectives, false);
82 configureContext('''
83 analyzer:
84 language:
85 enableConditionalDirectives: true
86 ''');
87 expect(analysisOptions.enableConditionalDirectives, true);
88 }
89
80 test_configure_enableSuperMixins() { 90 test_configure_enableSuperMixins() {
81 configureContext(''' 91 configureContext('''
82 analyzer: 92 analyzer:
83 language: 93 language:
84 enableSuperMixins: true 94 enableSuperMixins: true
85 '''); 95 ''');
86 expect(analysisOptions.enableSuperMixins, true); 96 expect(analysisOptions.enableSuperMixins, true);
87 } 97 }
88 98
89 test_configure_error_processors() { 99 test_configure_error_processors() {
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]); 387 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]);
378 } 388 }
379 389
380 void validate(String source, List<AnalysisOptionsErrorCode> expected) { 390 void validate(String source, List<AnalysisOptionsErrorCode> expected) {
381 var options = optionsProvider.getOptionsFromString(source); 391 var options = optionsProvider.getOptionsFromString(source);
382 var errors = validator.validate(options); 392 var errors = validator.validate(options);
383 expect(errors.map((AnalysisError e) => e.errorCode), 393 expect(errors.map((AnalysisError e) => e.errorCode),
384 unorderedEquals(expected)); 394 unorderedEquals(expected));
385 } 395 }
386 } 396 }
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