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

Unified Diff: pkg/analyzer/test/src/command_line/arguments_test.dart

Issue 2571583007: move extractDefinedVariables from analyzer cli to analyzer (Closed)
Patch Set: add TODO indicating future work Created 4 years 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/src/command_line/arguments.dart ('k') | pkg/analyzer_cli/lib/src/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/command_line/arguments_test.dart
diff --git a/pkg/analyzer/test/src/command_line/arguments_test.dart b/pkg/analyzer/test/src/command_line/arguments_test.dart
index 17aff4141290ea36e0257e48d505ff3b557137f3..8ed6dba80d1818ffaf10b0cc627a4b76e5f164bf 100644
--- a/pkg/analyzer/test/src/command_line/arguments_test.dart
+++ b/pkg/analyzer/test/src/command_line/arguments_test.dart
@@ -142,6 +142,18 @@ class ArgumentsTest {
expect(parser.options, hasLength(12));
}
+ void test_extractDefinedVariables() {
+ List<String> args = ['--a', '-Dbaz', 'go', 'back=blue', '-Dx'];
+ Map<String, String> definedVariables = {'one': 'two'};
+ args = extractDefinedVariables(args, definedVariables);
+ expect(args, orderedEquals(['--a', 'back=blue', '-Dx']));
+ expect(definedVariables['one'], 'two');
+ expect(definedVariables['two'], isNull);
+ expect(definedVariables['baz'], 'go');
+ expect(definedVariables['go'], isNull);
+ expect(definedVariables, hasLength(2));
+ }
+
void test_filterUnknownArguments() {
List<String> args = ['--a', '--b', '--c', 'foo', 'bar'];
ArgParser parser = new ArgParser();
« no previous file with comments | « pkg/analyzer/lib/src/command_line/arguments.dart ('k') | pkg/analyzer_cli/lib/src/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698