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

Unified Diff: test/parse_test.dart

Issue 849023002: format code, removed unused variables and deprecated usage (Closed) Base URL: https://github.com/dart-lang/args.git@master
Patch Set: nits Created 5 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
« no previous file with comments | « test/command_test.dart ('k') | test/trailing_options_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/parse_test.dart
diff --git a/test/parse_test.dart b/test/parse_test.dart
index 56320d6018e36cc00e3a54e721e04005b17ef318..0dd00ba4956449006f339c44bc97b75b41f6360e 100644
--- a/test/parse_test.dart
+++ b/test/parse_test.dart
@@ -105,17 +105,16 @@ void main() {
var parser = new ArgParser();
parser.addFlag('a', callback: (value) => a = value);
- var args = parser.parse(['--a']);
+ parser.parse(['--a']);
expect(a, isTrue);
});
test('for absent flags are invoked with the default value', () {
var a;
var parser = new ArgParser();
- parser.addFlag('a', defaultsTo: false,
- callback: (value) => a = value);
+ parser.addFlag('a', defaultsTo: false, callback: (value) => a = value);
- var args = parser.parse([]);
+ parser.parse([]);
expect(a, isFalse);
});
@@ -124,7 +123,7 @@ void main() {
var parser = new ArgParser();
parser.addFlag('a', callback: (value) => a = value);
- var args = parser.parse([]);
+ parser.parse([]);
expect(a, isFalse);
});
@@ -133,17 +132,16 @@ void main() {
var parser = new ArgParser();
parser.addOption('a', callback: (value) => a = value);
- var args = parser.parse(['--a=v']);
+ parser.parse(['--a=v']);
expect(a, equals('v'));
});
test('for absent options are invoked with the default value', () {
var a;
var parser = new ArgParser();
- parser.addOption('a', defaultsTo: 'v',
- callback: (value) => a = value);
+ parser.addOption('a', defaultsTo: 'v', callback: (value) => a = value);
- var args = parser.parse([]);
+ parser.parse([]);
expect(a, equals('v'));
});
@@ -152,51 +150,53 @@ void main() {
var parser = new ArgParser();
parser.addOption('a', callback: (value) => a = value);
- var args = parser.parse([]);
+ parser.parse([]);
expect(a, isNull);
});
test('for multiple present, allowMultiple, options are invoked with '
- 'value as a list', () {
+ 'value as a list', () {
var a;
var parser = new ArgParser();
- parser.addOption('a', allowMultiple: true,
- callback: (value) => a = value);
+ parser.addOption('a',
+ allowMultiple: true, callback: (value) => a = value);
- var args = parser.parse(['--a=v', '--a=x']);
+ parser.parse(['--a=v', '--a=x']);
expect(a, equals(['v', 'x']));
});
test('for single present, allowMultiple, options are invoked with '
- ' value as a single element list', () {
+ ' value as a single element list', () {
var a;
var parser = new ArgParser();
- parser.addOption('a', allowMultiple: true,
- callback: (value) => a = value);
+ parser.addOption('a',
+ allowMultiple: true, callback: (value) => a = value);
- var args = parser.parse(['--a=v']);
+ parser.parse(['--a=v']);
expect(a, equals(['v']));
});
test('for absent, allowMultiple, options are invoked with default '
- 'value as a list.', () {
+ 'value as a list.', () {
var a;
var parser = new ArgParser();
- parser.addOption('a', allowMultiple: true, defaultsTo: 'v',
+ parser.addOption('a',
+ allowMultiple: true,
+ defaultsTo: 'v',
callback: (value) => a = value);
- var args = parser.parse([]);
+ parser.parse([]);
expect(a, equals(['v']));
});
test('for absent, allowMultiple, options are invoked with value '
- 'as an empty list.', () {
+ 'as an empty list.', () {
var a;
var parser = new ArgParser();
- parser.addOption('a', allowMultiple: true,
- callback: (value) => a = value);
+ parser.addOption('a',
+ allowMultiple: true, callback: (value) => a = value);
- var args = parser.parse([]);
+ parser.parse([]);
expect(a, isEmpty);
});
});
@@ -392,11 +392,11 @@ void main() {
var args = parser.parse(['--define=1']);
expect(args['define'], equals(['1']));
args = parser.parse(['--define=1', '--define=2']);
- expect(args['define'], equals(['1','2']));
+ expect(args['define'], equals(['1', '2']));
});
test('returns the default value for multi-valued arguments '
- 'if not explicitly set', () {
+ 'if not explicitly set', () {
var parser = new ArgParser();
parser.addOption('define', defaultsTo: '0', allowMultiple: true);
var args = parser.parse(['']);
« no previous file with comments | « test/command_test.dart ('k') | test/trailing_options_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698