| Index: pkg/analyzer/test/options_test.dart
|
| diff --git a/pkg/analyzer/test/options_test.dart b/pkg/analyzer/test/options_test.dart
|
| index b9fdfa2c885e53e2ebfafdd2fe5fca9917d77468..96270a9e5d2baac9a10b2790169762560f0fa274 100644
|
| --- a/pkg/analyzer/test/options_test.dart
|
| +++ b/pkg/analyzer/test/options_test.dart
|
| @@ -35,6 +35,19 @@ main() {
|
| expect(options.shouldBatch, isTrue);
|
| });
|
|
|
| + test('defined variables', () {
|
| + CommandLineOptions options = CommandLineOptions
|
| + .parse(['--dart-sdk', '.', '-Dfoo=bar', 'foo.dart']);
|
| + expect(options.definedVariables['foo'], equals('bar'));
|
| + expect(options.definedVariables['bar'], isNull);
|
| + });
|
| +
|
| + test('log', () {
|
| + CommandLineOptions options = CommandLineOptions
|
| + .parse(['--dart-sdk', '.', '--log', 'foo.dart']);
|
| + expect(options.log, isTrue);
|
| + });
|
| +
|
| test('machine format', () {
|
| CommandLineOptions options = CommandLineOptions
|
| .parse(['--dart-sdk', '.', '--format=machine', 'foo.dart']);
|
| @@ -47,10 +60,10 @@ main() {
|
| expect(options.disableHints, isTrue);
|
| });
|
|
|
| - test('perf', () {
|
| + test('package root', () {
|
| CommandLineOptions options = CommandLineOptions
|
| - .parse(['--dart-sdk', '.', '--perf', 'foo.dart']);
|
| - expect(options.perf, isTrue);
|
| + .parse(['--dart-sdk', '.', '-p', 'bar', 'foo.dart']);
|
| + expect(options.packageRootPath, equals('bar'));
|
| });
|
|
|
| test('package warnings', () {
|
| @@ -59,28 +72,16 @@ main() {
|
| expect(options.showPackageWarnings, isTrue);
|
| });
|
|
|
| - test('sdk warnings', () {
|
| - CommandLineOptions options = CommandLineOptions
|
| - .parse(['--dart-sdk', '.', '--warnings', 'foo.dart']);
|
| - expect(options.showSdkWarnings, isTrue);
|
| - });
|
| -
|
| - test('warningsAreFatal', () {
|
| - CommandLineOptions options = CommandLineOptions
|
| - .parse(['--dart-sdk', '.', '--fatal-warnings', 'foo.dart']);
|
| - expect(options.warningsAreFatal, isTrue);
|
| - });
|
| -
|
| - test('package root', () {
|
| + test('perf', () {
|
| CommandLineOptions options = CommandLineOptions
|
| - .parse(['--dart-sdk', '.', '-p', 'bar', 'foo.dart']);
|
| - expect(options.packageRootPath, equals('bar'));
|
| + .parse(['--dart-sdk', '.', '--perf', 'foo.dart']);
|
| + expect(options.perf, isTrue);
|
| });
|
|
|
| - test('log', () {
|
| + test('sdk warnings', () {
|
| CommandLineOptions options = CommandLineOptions
|
| - .parse(['--dart-sdk', '.', '--log', 'foo.dart']);
|
| - expect(options.log, isTrue);
|
| + .parse(['--dart-sdk', '.', '--warnings', 'foo.dart']);
|
| + expect(options.showSdkWarnings, isTrue);
|
| });
|
|
|
| test('sourceFiles', () {
|
| @@ -89,6 +90,12 @@ main() {
|
| expect(options.sourceFiles, equals(['foo.dart', 'foo2.dart', 'foo3.dart']));
|
| });
|
|
|
| + test('warningsAreFatal', () {
|
| + CommandLineOptions options = CommandLineOptions
|
| + .parse(['--dart-sdk', '.', '--fatal-warnings', 'foo.dart']);
|
| + expect(options.warningsAreFatal, isTrue);
|
| + });
|
| +
|
| // test('notice unrecognized flags', () {
|
| // CommandLineOptions options = new CommandLineOptions.parse(['--bar', '--baz',
|
| // 'foo.dart']);
|
|
|