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

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

Issue 290733010: Parse defined variables in command-line analyzer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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
« pkg/analyzer/lib/options.dart ('K') | « pkg/analyzer/lib/options.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 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']);
« pkg/analyzer/lib/options.dart ('K') | « pkg/analyzer/lib/options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698