2ff0092e2a
Review URL: https://codereview.chromium.org//12035030 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17418 260f80e4-7a28-3924-810f-c04153c831b5
44 lines
1.3 KiB
Dart
44 lines
1.3 KiB
Dart
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
library options_test;
|
|
|
|
import 'package:unittest/unittest.dart';
|
|
import 'package:analyzer-experimental/options.dart';
|
|
|
|
main() {
|
|
|
|
group('AnalyzerOptions.parse()', () {
|
|
|
|
test('defaults', () {
|
|
CommandLineOptions options = new CommandLineOptions.parse(['foo.dart']);
|
|
expect(options, isNotNull);
|
|
expect(options.shouldBatch, isFalse);
|
|
expect(options.machineFormat, isFalse);
|
|
expect(options.ignoreUnrecognizedFlags, isFalse);
|
|
expect(options.showMetrics, isFalse);
|
|
expect(options.warningsAreFatal, isFalse);
|
|
expect(options.dartSdkPath, isNull);
|
|
expect(options.sourceFiles, equals(['foo.dart']));
|
|
|
|
});
|
|
|
|
test('notice unrecognized flags', () {
|
|
CommandLineOptions options = new CommandLineOptions.parse(['--bar', '--baz',
|
|
'foo.dart']);
|
|
expect(options, isNull);
|
|
});
|
|
|
|
test('ignore unrecognized flags', () {
|
|
CommandLineOptions options = new CommandLineOptions.parse([
|
|
'--ignore_unrecognized_flags', '--bar', '--baz', 'foo.dart']);
|
|
expect(options, isNotNull);
|
|
expect(options.sourceFiles, equals(['foo.dart']));
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|