Skip to content

Commit 79e61e0

Browse files
authored
Add a test for passing allowedHelp without allowed (dart-archive/args#170)
Avoid a potential breaking solution for dart-lang/args#25
1 parent bd0fd38 commit 79e61e0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkgs/args/test/parse_test.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,16 @@ void main() {
433433
expect(args['mode'], equals('debug'));
434434
});
435435

436+
test('do not throw if there is no allowed set with allowedHelp', () {
437+
var parser = ArgParser();
438+
parser.addOption('mode', allowedHelp: {
439+
'debug': 'During development.',
440+
'release': 'For customers.'
441+
});
442+
var args = parser.parse(['--mode=profile']);
443+
expect(args['mode'], equals('profile'));
444+
});
445+
436446
test('throw if the value is not in the allowed set', () {
437447
var parser = ArgParser();
438448
parser.addOption('mode', allowed: ['debug', 'release']);

0 commit comments

Comments
 (0)