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 analyzer_cli.test.options; | 5 library analyzer_cli.test.options; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:analyzer_cli/src/driver.dart'; | 9 import 'package:analyzer_cli/src/driver.dart'; |
10 import 'package:analyzer_cli/src/options.dart'; | 10 import 'package:analyzer_cli/src/options.dart'; |
11 import 'package:args/args.dart'; | 11 import 'package:args/args.dart'; |
12 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 12 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
13 import 'package:unittest/unittest.dart'; | 13 import 'package:unittest/unittest.dart'; |
14 | 14 |
15 main() { | 15 main() { |
16 group('CommandLineOptions', () { | 16 group('CommandLineOptions', () { |
17 group('parse', () { | 17 group('parse', () { |
18 test('defaults', () { | 18 test('defaults', () { |
19 CommandLineOptions options = | 19 CommandLineOptions options = |
20 CommandLineOptions.parse(['--dart-sdk', '.', 'foo.dart']); | 20 CommandLineOptions.parse(['--dart-sdk', '.', 'foo.dart']); |
21 expect(options, isNotNull); | 21 expect(options, isNotNull); |
22 expect(options.dartSdkPath, isNotNull); | 22 expect(options.dartSdkPath, isNotNull); |
23 expect(options.disableHints, isFalse); | 23 expect(options.disableHints, isFalse); |
24 expect(options.lints, isFalse); | 24 expect(options.lints, isFalse); |
25 expect(options.displayVersion, isFalse); | 25 expect(options.displayVersion, isFalse); |
26 expect(options.enableStrictCallChecks, isFalse); | 26 expect(options.enableStrictCallChecks, isFalse); |
27 expect(options.enableSuperMixins, isFalse); | 27 expect(options.enableSuperMixins, isFalse); |
28 expect(options.enableConditionalDirectives, isFalse); | |
Brian Wilkerson
2016/03/09 03:31:10
Maybe a test showing that it's true when the flag
pquitslund
2016/03/09 18:04:31
Done.
| |
28 expect(options.enableTypeChecks, isFalse); | 29 expect(options.enableTypeChecks, isFalse); |
29 expect(options.hintsAreFatal, isFalse); | 30 expect(options.hintsAreFatal, isFalse); |
30 expect(options.ignoreUnrecognizedFlags, isFalse); | 31 expect(options.ignoreUnrecognizedFlags, isFalse); |
31 expect(options.log, isFalse); | 32 expect(options.log, isFalse); |
32 expect(options.machineFormat, isFalse); | 33 expect(options.machineFormat, isFalse); |
33 expect(options.packageMode, isFalse); | 34 expect(options.packageMode, isFalse); |
34 expect(options.packageRootPath, isNull); | 35 expect(options.packageRootPath, isNull); |
35 expect(options.packageSummaryInputs, isEmpty); | 36 expect(options.packageSummaryInputs, isEmpty); |
36 expect(options.shouldBatch, isFalse); | 37 expect(options.shouldBatch, isFalse); |
37 expect(options.showPackageWarnings, isFalse); | 38 expect(options.showPackageWarnings, isFalse); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 '/path/to/pkg' | 269 '/path/to/pkg' |
269 ]); | 270 ]); |
270 expect(options.packageMode, isTrue); | 271 expect(options.packageMode, isTrue); |
271 expect(options.packageSummaryOutput, '/path/to/output.sum'); | 272 expect(options.packageSummaryOutput, '/path/to/output.sum'); |
272 } | 273 } |
273 | 274 |
274 void _parse(List<String> args) { | 275 void _parse(List<String> args) { |
275 options = CommandLineOptions.parse(args); | 276 options = CommandLineOptions.parse(args); |
276 } | 277 } |
277 } | 278 } |
OLD | NEW |