| 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 18 matching lines...) Expand all Loading... |
| 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, isNull); | 38 expect(options.enableAssertInitializer, isNull); |
| 39 expect(options.hintsAreFatal, isFalse); | 39 expect(options.infosAreFatal, isFalse); |
| 40 expect(options.ignoreUnrecognizedFlags, isFalse); | 40 expect(options.ignoreUnrecognizedFlags, isFalse); |
| 41 expect(options.log, isFalse); | 41 expect(options.log, isFalse); |
| 42 expect(options.machineFormat, isFalse); | 42 expect(options.machineFormat, isFalse); |
| 43 expect(options.packageRootPath, isNull); | 43 expect(options.packageRootPath, isNull); |
| 44 expect(options.shouldBatch, isFalse); | 44 expect(options.shouldBatch, isFalse); |
| 45 expect(options.showPackageWarnings, isFalse); | 45 expect(options.showPackageWarnings, isFalse); |
| 46 expect(options.showSdkWarnings, isFalse); | 46 expect(options.showSdkWarnings, isFalse); |
| 47 expect(options.sourceFiles, equals(['foo.dart'])); | 47 expect(options.sourceFiles, equals(['foo.dart'])); |
| 48 expect(options.warningsAreFatal, isFalse); | 48 expect(options.warningsAreFatal, isFalse); |
| 49 expect(options.strongMode, isFalse); | 49 expect(options.strongMode, isFalse); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 test('enable assert initializers', () { | 90 test('enable assert initializers', () { |
| 91 CommandLineOptions options = CommandLineOptions.parse( | 91 CommandLineOptions options = CommandLineOptions.parse( |
| 92 ['--dart-sdk', '.', '--enable-assert-initializers', 'foo.dart']); | 92 ['--dart-sdk', '.', '--enable-assert-initializers', 'foo.dart']); |
| 93 expect(options.enableAssertInitializer, isTrue); | 93 expect(options.enableAssertInitializer, isTrue); |
| 94 }); | 94 }); |
| 95 | 95 |
| 96 test('hintsAreFatal', () { | 96 test('hintsAreFatal', () { |
| 97 CommandLineOptions options = CommandLineOptions | 97 CommandLineOptions options = CommandLineOptions |
| 98 .parse(['--dart-sdk', '.', '--fatal-hints', 'foo.dart']); | 98 .parse(['--dart-sdk', '.', '--fatal-hints', 'foo.dart']); |
| 99 expect(options.hintsAreFatal, isTrue); | 99 expect(options.infosAreFatal, isTrue); |
| 100 }); |
| 101 |
| 102 test('infosAreFatal', () { |
| 103 CommandLineOptions options = CommandLineOptions |
| 104 .parse(['--dart-sdk', '.', '--fatal-infos', 'foo.dart']); |
| 105 expect(options.infosAreFatal, isTrue); |
| 100 }); | 106 }); |
| 101 | 107 |
| 102 test('log', () { | 108 test('log', () { |
| 103 CommandLineOptions options = | 109 CommandLineOptions options = |
| 104 CommandLineOptions.parse(['--dart-sdk', '.', '--log', 'foo.dart']); | 110 CommandLineOptions.parse(['--dart-sdk', '.', '--log', 'foo.dart']); |
| 105 expect(options.log, isTrue); | 111 expect(options.log, isTrue); |
| 106 }); | 112 }); |
| 107 | 113 |
| 108 test('machine format', () { | 114 test('machine format', () { |
| 109 CommandLineOptions options = CommandLineOptions | 115 CommandLineOptions options = CommandLineOptions |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 'package:p/foo.dart|/path/to/p/lib/foo.dart' | 374 'package:p/foo.dart|/path/to/p/lib/foo.dart' |
| 369 ]); | 375 ]); |
| 370 expect(options.buildMode, isTrue); | 376 expect(options.buildMode, isTrue); |
| 371 expect(options.buildSuppressExitCode, isTrue); | 377 expect(options.buildSuppressExitCode, isTrue); |
| 372 } | 378 } |
| 373 | 379 |
| 374 void _parse(List<String> args) { | 380 void _parse(List<String> args) { |
| 375 options = CommandLineOptions.parse(args); | 381 options = CommandLineOptions.parse(args); |
| 376 } | 382 } |
| 377 } | 383 } |
| OLD | NEW |