Skip to content

Commit

Permalink
passing long tests ripped out of parse.js
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jun 25, 2013
1 parent f8a5341 commit 7972c4a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/long.js
@@ -0,0 +1,31 @@
var test = require('tape');
var parse = require('../');

test('long opts', function (t) {
t.deepEqual(
parse([ '--bool' ]),
{ bool : true, _ : [] },
'long boolean'
);
t.deepEqual(
parse([ '--pow', 'xixxle' ]),
{ pow : 'xixxle', _ : [] },
'long capture sp'
);
t.deepEqual(
parse([ '--pow=xixxle' ]),
{ pow : 'xixxle', _ : [] },
'long capture eq'
);
t.deepEqual(
parse([ '--host', 'localhost', '--port', '555' ]),
{ host : 'localhost', port : 555, _ : [] },
'long captures sp'
);
t.deepEqual(
parse([ '--host=localhost', '--port=555' ]),
{ host : 'localhost', port : 555, _ : [] },
'long captures eq'
);
t.end();
});

0 comments on commit 7972c4a

Please sign in to comment.