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

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

Issue 944073003: Fix for filtering unknown options. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/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 78365ac0913a65396f416d0abd8fdaaa8fcec620..4830306182a51e0a9d73fa7869c4a1ff927bf66e 100644
--- a/pkg/analyzer/test/options_test.dart
+++ b/pkg/analyzer/test/options_test.dart
@@ -5,8 +5,10 @@
library options_test;
import 'package:analyzer/options.dart';
-import 'package:unittest/unittest.dart';
import 'package:args/args.dart';
+import 'package:unittest/unittest.dart';
+
+import 'reflective_tests.dart';
main() {
@@ -146,4 +148,20 @@ main() {
});
+ runReflectiveTests(CommandLineParserTest);
+}
+
+
+@reflectiveTest
+class CommandLineParserTest {
+ test_ignoreUnrecognizedOptions() {
+ CommandLineParser parser =
+ new CommandLineParser(alwaysIgnoreUnrecognized: true);
+ parser.addOption('optionA');
+ parser.addFlag('flagA');
+ ArgResults argResults =
+ parser.parse(['--optionA=1', '--optionB=2', '--flagA'], {});
+ expect(argResults['optionA'], '1');
+ expect(argResults['flagA'], isTrue);
+ }
}
« no previous file with comments | « pkg/analyzer/lib/options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698