Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated test for nargs+append combination

  • Loading branch information...
commit 40115ef5db512b0d8dfa8b16627d6b2661415a41 1 parent 1426b3e
@puzrin puzrin authored
Showing with 5 additions and 9 deletions.
  1. +5 −9 test/nargs.js
View
14 test/nargs.js
@@ -725,17 +725,13 @@ describe('nargs', function () {
});
// Added after bug in ndoc
- it.skip('test a Positional that specifies unlimited nargs, alternate definition', function () {
+ it('test a `nargs` + `append` combination. Not obvious result - nested array', function () {
parser = new ArgumentParser({debug: true});
- parser.addArgument([ 'paths' ], {
- help: 'Source files location',
- metavar: 'PATH',
- action: 'append',
- nargs: '+'
- });
+ parser.addArgument([ 'foo' ], { action: 'append', nargs: '+' });
- args = parser.parseArgs([ 'lib/', 'examples/' ]);
- assert.deepEqual(args, { paths: [ 'lib/', 'examples/' ] });
+ args = parser.parseArgs([ 'a', 'b' ]);
+ // YES, NESTED array, don't try to 'fix' it.
+ assert.deepEqual(args, { foo: [[ 'a', 'b' ]] });
});
Please sign in to comment.
Something went wrong with that request. Please try again.