Chromium Code Reviews| Index: tests/lib/args/args_test.dart |
| =================================================================== |
| --- tests/lib/args/args_test.dart (revision 10607) |
| +++ tests/lib/args/args_test.dart (working copy) |
| @@ -381,6 +381,22 @@ |
| var args = parser.parse(['']); |
| expect(args['define'], equals(['0'])); |
| }); |
| + |
| + test('queries the default value', () { |
|
Bob Nystrom
2012/08/16 22:22:10
Move these to a separate group for the getDefault(
gram
2012/08/16 23:20:17
Done.
|
| + var parser = new ArgParser(); |
| + parser.addOption('define', defaultsTo:'0', allowMultiple: true); |
|
Bob Nystrom
2012/08/16 22:22:10
Space after ":".
gram
2012/08/16 23:20:17
Done.
|
| + expect(parser.getDefault('define'), equals('0')); |
| + expect(()=>parser.getDefault('undefine'), |
|
Bob Nystrom
2012/08/16 22:22:10
If it's OK with you, I would make this a separate
gram
2012/08/16 23:20:17
Done.
|
| + throwsIllegalArgumentException); |
| + }); |
| + |
| + test('queries the set options', () { |
|
Bob Nystrom
2012/08/16 22:22:10
This should be a separate group for the ".options"
gram
2012/08/16 23:20:17
Done.
|
| + var parser = new ArgParser(); |
| + parser.addFlag('woof', defaultsTo: false); |
| + parser.addOption('meow', defaultsTo: 'kitty'); |
| + var args = parser.parse([]); |
| + expect(args.options, hasLength(2)); |
| + }); |
| }); |
| group('remaining args', () { |