Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
passing long tests ripped out of parse.js
- Loading branch information
James Halliday
committed
Jun 25, 2013
1 parent
f8a5341
commit 7972c4a
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
}); |