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'; |
(...skipping 17 matching lines...) Expand all Loading... |
28 expect(options.buildSummaryOutputSemantic, isNull); | 28 expect(options.buildSummaryOutputSemantic, isNull); |
29 expect(options.buildSuppressExitCode, isFalse); | 29 expect(options.buildSuppressExitCode, isFalse); |
30 expect(options.dartSdkPath, isNotNull); | 30 expect(options.dartSdkPath, isNotNull); |
31 expect(options.disableCacheFlushing, isFalse); | 31 expect(options.disableCacheFlushing, isFalse); |
32 expect(options.disableHints, isFalse); | 32 expect(options.disableHints, isFalse); |
33 expect(options.lints, isFalse); | 33 expect(options.lints, isFalse); |
34 expect(options.displayVersion, isFalse); | 34 expect(options.displayVersion, isFalse); |
35 expect(options.enableStrictCallChecks, isFalse); | 35 expect(options.enableStrictCallChecks, isFalse); |
36 expect(options.enableSuperMixins, isFalse); | 36 expect(options.enableSuperMixins, isFalse); |
37 expect(options.enableTypeChecks, isFalse); | 37 expect(options.enableTypeChecks, isFalse); |
| 38 expect(options.enableAssertInitializer, isFalse); |
38 expect(options.hintsAreFatal, isFalse); | 39 expect(options.hintsAreFatal, isFalse); |
39 expect(options.ignoreUnrecognizedFlags, isFalse); | 40 expect(options.ignoreUnrecognizedFlags, isFalse); |
40 expect(options.log, isFalse); | 41 expect(options.log, isFalse); |
41 expect(options.machineFormat, isFalse); | 42 expect(options.machineFormat, isFalse); |
42 expect(options.packageRootPath, isNull); | 43 expect(options.packageRootPath, isNull); |
43 expect(options.shouldBatch, isFalse); | 44 expect(options.shouldBatch, isFalse); |
44 expect(options.showPackageWarnings, isFalse); | 45 expect(options.showPackageWarnings, isFalse); |
45 expect(options.showSdkWarnings, isFalse); | 46 expect(options.showSdkWarnings, isFalse); |
46 expect(options.sourceFiles, equals(['foo.dart'])); | 47 expect(options.sourceFiles, equals(['foo.dart'])); |
47 expect(options.warningsAreFatal, isFalse); | 48 expect(options.warningsAreFatal, isFalse); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 .parse(['--dart-sdk', '.', '--supermixin', 'foo.dart']); | 80 .parse(['--dart-sdk', '.', '--supermixin', 'foo.dart']); |
80 expect(options.enableSuperMixins, isTrue); | 81 expect(options.enableSuperMixins, isTrue); |
81 }); | 82 }); |
82 | 83 |
83 test('enable type checks', () { | 84 test('enable type checks', () { |
84 CommandLineOptions options = CommandLineOptions | 85 CommandLineOptions options = CommandLineOptions |
85 .parse(['--dart-sdk', '.', '--enable_type_checks', 'foo.dart']); | 86 .parse(['--dart-sdk', '.', '--enable_type_checks', 'foo.dart']); |
86 expect(options.enableTypeChecks, isTrue); | 87 expect(options.enableTypeChecks, isTrue); |
87 }); | 88 }); |
88 | 89 |
| 90 test('enable assert initializers', () { |
| 91 CommandLineOptions options = CommandLineOptions.parse( |
| 92 ['--dart-sdk', '.', '--enable-assert-initializers', 'foo.dart']); |
| 93 expect(options.enableAssertInitializer, isTrue); |
| 94 }); |
| 95 |
89 test('hintsAreFatal', () { | 96 test('hintsAreFatal', () { |
90 CommandLineOptions options = CommandLineOptions | 97 CommandLineOptions options = CommandLineOptions |
91 .parse(['--dart-sdk', '.', '--fatal-hints', 'foo.dart']); | 98 .parse(['--dart-sdk', '.', '--fatal-hints', 'foo.dart']); |
92 expect(options.hintsAreFatal, isTrue); | 99 expect(options.hintsAreFatal, isTrue); |
93 }); | 100 }); |
94 | 101 |
95 test('log', () { | 102 test('log', () { |
96 CommandLineOptions options = | 103 CommandLineOptions options = |
97 CommandLineOptions.parse(['--dart-sdk', '.', '--log', 'foo.dart']); | 104 CommandLineOptions.parse(['--dart-sdk', '.', '--log', 'foo.dart']); |
98 expect(options.log, isTrue); | 105 expect(options.log, isTrue); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 'package:p/foo.dart|/path/to/p/lib/foo.dart' | 368 'package:p/foo.dart|/path/to/p/lib/foo.dart' |
362 ]); | 369 ]); |
363 expect(options.buildMode, isTrue); | 370 expect(options.buildMode, isTrue); |
364 expect(options.buildSuppressExitCode, isTrue); | 371 expect(options.buildSuppressExitCode, isTrue); |
365 } | 372 } |
366 | 373 |
367 void _parse(List<String> args) { | 374 void _parse(List<String> args) { |
368 options = CommandLineOptions.parse(args); | 375 options = CommandLineOptions.parse(args); |
369 } | 376 } |
370 } | 377 } |
OLD | NEW |