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

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

Issue 1892523002: Clean up flags for conditional directives (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/test/generated/parser_test.dart ('k') | pkg/analyzer_cli/lib/src/driver.dart » ('j') | 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 test_configure_enableAsync_false() { 61 test_configure_enableAsync_false() {
62 configureContext(''' 62 configureContext('''
63 analyzer: 63 analyzer:
64 language: 64 language:
65 enableAsync: false 65 enableAsync: false
66 '''); 66 ''');
67 expect(analysisOptions.enableAsync, false); 67 expect(analysisOptions.enableAsync, false);
68 } 68 }
69 69
70 test_configure_enableConditionalDirectives() {
71 expect(analysisOptions.enableConditionalDirectives, true);
72 configureContext('''
73 analyzer:
74 language:
75 enableConditionalDirectives: true
76 ''');
77 expect(analysisOptions.enableConditionalDirectives, true);
78 }
79
80 test_configure_enableGenericMethods() { 70 test_configure_enableGenericMethods() {
81 expect(analysisOptions.enableGenericMethods, false); 71 expect(analysisOptions.enableGenericMethods, false);
82 configureContext(''' 72 configureContext('''
83 analyzer: 73 analyzer:
84 language: 74 language:
85 enableGenericMethods: true 75 enableGenericMethods: true
86 '''); 76 ''');
87 expect(analysisOptions.enableGenericMethods, true); 77 expect(analysisOptions.enableGenericMethods, true);
88 } 78 }
89 79
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]); 389 [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE]);
400 } 390 }
401 391
402 void validate(String source, List<ErrorCode> expected) { 392 void validate(String source, List<ErrorCode> expected) {
403 var options = optionsProvider.getOptionsFromString(source); 393 var options = optionsProvider.getOptionsFromString(source);
404 var errors = validator.validate(options); 394 var errors = validator.validate(options);
405 expect(errors.map((AnalysisError e) => e.errorCode), 395 expect(errors.map((AnalysisError e) => e.errorCode),
406 unorderedEquals(expected)); 396 unorderedEquals(expected));
407 } 397 }
408 } 398 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/parser_test.dart ('k') | pkg/analyzer_cli/lib/src/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698