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

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

Issue 11938028: Experimental analyzer front-end baby-steps. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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
Index: pkg/analyzer-experimental/test/options_test.dart
===================================================================
--- pkg/analyzer-experimental/test/options_test.dart (revision 0)
+++ pkg/analyzer-experimental/test/options_test.dart (revision 0)
@@ -0,0 +1,43 @@
+// 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/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.showMetrics, isFalse);
+ expect(options.warningsAreFatal, isFalse);
+ expect(options.dartSdkPath, isNull);
+ expect(options.sourceFiles, equals(['foo.dart']));
+
+ });
+
+ test('notice unrecognized flags', () {
+ CommandLineOptions options = CommandLineOptions.parse(['--bar', '--baz',
+ 'foo.dart']);
+ expect(options, isNull);
+ });
+
+ test('ignore unrecognized flags', () {
+ CommandLineOptions options = CommandLineOptions.parse([
+ '--ignore_unrecognized_flags', '--bar', '--baz', 'foo.dart']);
+ expect(options, isNotNull);
+ expect(options.sourceFiles, equals(['foo.dart']));
+ });
+
+ });
+
+}
+
« pkg/analyzer-experimental/lib/options.dart ('K') | « pkg/analyzer-experimental/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698