Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2760)

Unified Diff: pkg/analyzer/test/options_test.dart

Issue 199543002: Addtional tests in options.dart to cover 'log' case, and other missed flag tests as they were added. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/test/error_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/options_test.dart
diff --git a/pkg/analyzer/test/options_test.dart b/pkg/analyzer/test/options_test.dart
index 6dde78b7f73ffd6e9899f55f014d9f8cdcda31f8..b9fdfa2c885e53e2ebfafdd2fe5fca9917d77468 100644
--- a/pkg/analyzer/test/options_test.dart
+++ b/pkg/analyzer/test/options_test.dart
@@ -17,24 +17,40 @@ main() {
expect(options, isNotNull);
expect(options.shouldBatch, isFalse);
expect(options.machineFormat, isFalse);
+ expect(options.displayVersion, isFalse);
+ expect(options.disableHints, isFalse);
expect(options.ignoreUnrecognizedFlags, isFalse);
+ expect(options.perf, isFalse);
expect(options.showPackageWarnings, isFalse);
expect(options.showSdkWarnings, isFalse);
expect(options.warningsAreFatal, isFalse);
expect(options.dartSdkPath, isNotNull);
+ expect(options.log, isFalse);
expect(options.sourceFiles, equals(['foo.dart']));
});
+ test('batch', () {
+ CommandLineOptions options = CommandLineOptions
+ .parse(['--dart-sdk', '.', '--batch']);
+ expect(options.shouldBatch, isTrue);
+ });
+
test('machine format', () {
CommandLineOptions options = CommandLineOptions
.parse(['--dart-sdk', '.', '--format=machine', 'foo.dart']);
expect(options.machineFormat, isTrue);
});
- test('package root', () {
+ test('no-hints', () {
CommandLineOptions options = CommandLineOptions
- .parse(['--dart-sdk', '.', '-p', 'bar', 'foo.dart']);
- expect(options.packageRootPath, equals('bar'));
+ .parse(['--dart-sdk', '.', '--no-hints', 'foo.dart']);
+ expect(options.disableHints, isTrue);
+ });
+
+ test('perf', () {
+ CommandLineOptions options = CommandLineOptions
+ .parse(['--dart-sdk', '.', '--perf', 'foo.dart']);
+ expect(options.perf, isTrue);
});
test('package warnings', () {
@@ -49,6 +65,30 @@ main() {
expect(options.showSdkWarnings, isTrue);
});
+ test('warningsAreFatal', () {
+ CommandLineOptions options = CommandLineOptions
+ .parse(['--dart-sdk', '.', '--fatal-warnings', 'foo.dart']);
+ expect(options.warningsAreFatal, isTrue);
+ });
+
+ test('package root', () {
+ CommandLineOptions options = CommandLineOptions
+ .parse(['--dart-sdk', '.', '-p', 'bar', 'foo.dart']);
+ expect(options.packageRootPath, equals('bar'));
+ });
+
+ test('log', () {
+ CommandLineOptions options = CommandLineOptions
+ .parse(['--dart-sdk', '.', '--log', 'foo.dart']);
+ expect(options.log, isTrue);
+ });
+
+ test('sourceFiles', () {
+ CommandLineOptions options = CommandLineOptions
+ .parse(['--dart-sdk', '.', '--log', 'foo.dart', 'foo2.dart', 'foo3.dart']);
+ expect(options.sourceFiles, equals(['foo.dart', 'foo2.dart', 'foo3.dart']));
+ });
+
// test('notice unrecognized flags', () {
// CommandLineOptions options = new CommandLineOptions.parse(['--bar', '--baz',
// 'foo.dart']);
@@ -65,4 +105,3 @@ main() {
});
}
-
« no previous file with comments | « pkg/analyzer/test/error_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698