Skip to content

Commit

Permalink
more tests for long and short captures
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Sep 10, 2010
1 parent ab6387e commit da74dea
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,28 @@ exports['short capture'] = function (assert) {
);
};

exports['short captures'] = function (assert) {
assert.deepEqual(
optimist.parse([ '-h', 'localhost', '-p', '555' ]),
{ h : 'localhost', p : '555', _ : [] }
);
};


exports['long capture'] = function (assert) {
assert.deepEqual(
optimist.parse([ '--pow=xixxle' ]),
{ pow : 'xixxle', _ : [] }
);
};

exports['long captures'] = function (assert) {
assert.deepEqual(
optimist.parse([ '--host=localhost', '--port=555' ]),
{ host : 'localhost', port : '555', _ : [] }
);
};

exports['mixed short bool and capture'] = function (assert) {
assert.deepEqual(
optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
Expand Down

0 comments on commit da74dea

Please sign in to comment.