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

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

Issue 32823008: normalize cmdline analyzer flags for dart based analyzer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 7 years, 2 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_experimental/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_experimental/test/options_test.dart
diff --git a/pkg/analyzer_experimental/test/options_test.dart b/pkg/analyzer_experimental/test/options_test.dart
index 67b846701870f4bbf814c231df0dc396c940f8ea..c4c9a34338dd8dbf359e2191a8249d881ed9cbf1 100644
--- a/pkg/analyzer_experimental/test/options_test.dart
+++ b/pkg/analyzer_experimental/test/options_test.dart
@@ -5,23 +5,48 @@
library options_test;
import 'package:unittest/unittest.dart';
-//import 'package:analyzer_experimental/options.dart';
+import 'package:analyzer_experimental/options.dart';
main() {
group('AnalyzerOptions.parse()', () {
test('defaults', () {
-// CommandLineOptions options = CommandLineOptions.parse(['foo.dart']);
-// expect(options, isNotNull);
-// expect(options.shouldBatch, isFalse);
-// expect(options.machineFormat, isFalse);
-// expect(options.ignoreUnrecognizedFlags, isFalse);
-// expect(options.showPackageWarnings, isFalse);
-// expect(options.showSdkWarnings, isFalse);
-// expect(options.warningsAreFatal, isFalse);
-// expect(options.dartSdkPath, isNull);
-// expect(options.sourceFiles, equals(['foo.dart']));
+ CommandLineOptions options = CommandLineOptions
+ .parse(['--dart-sdk', '.', 'foo.dart']);
+ expect(options, isNotNull);
+ expect(options.shouldBatch, isFalse);
+ expect(options.machineFormat, isFalse);
+ expect(options.ignoreUnrecognizedFlags, isFalse);
+ expect(options.showPackageWarnings, isFalse);
+ expect(options.showSdkWarnings, isFalse);
+ expect(options.warningsAreFatal, isFalse);
+ expect(options.dartSdkPath, isNotNull);
+ expect(options.sourceFiles, equals(['foo.dart']));
+ });
+
+ test('machine format', () {
+ CommandLineOptions options = CommandLineOptions
+ .parse(['--dart-sdk', '.', '--format=machine', 'foo.dart']);
+ expect(options.machineFormat, isTrue);
+ });
+
+ test('package root', () {
+ CommandLineOptions options = CommandLineOptions
+ .parse(['--dart-sdk', '.', '-p', 'bar', 'foo.dart']);
+ expect(options.packageRootPath, equals('bar'));
+ });
+
+ test('package warnings', () {
+ CommandLineOptions options = CommandLineOptions
+ .parse(['--dart-sdk', '.', '--package-warnings', 'foo.dart']);
+ expect(options.showPackageWarnings, isTrue);
+ });
+
+ test('sdk warnings', () {
+ CommandLineOptions options = CommandLineOptions
+ .parse(['--dart-sdk', '.', '--warnings', 'foo.dart']);
+ expect(options.showSdkWarnings, isTrue);
});
// test('notice unrecognized flags', () {
« no previous file with comments | « pkg/analyzer_experimental/lib/options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698