blob: 5d3a1e09d3b64ca2f00ce89e5d3447b4bcafb34e [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001var test = require('tape');
2var parse = require('../');
3
4test('long opts', function (t) {
5 t.deepEqual(
6 parse([ '--bool' ]),
7 { bool : true, _ : [] },
8 'long boolean'
9 );
10 t.deepEqual(
11 parse([ '--pow', 'xixxle' ]),
12 { pow : 'xixxle', _ : [] },
13 'long capture sp'
14 );
15 t.deepEqual(
16 parse([ '--pow=xixxle' ]),
17 { pow : 'xixxle', _ : [] },
18 'long capture eq'
19 );
20 t.deepEqual(
21 parse([ '--host', 'localhost', '--port', '555' ]),
22 { host : 'localhost', port : 555, _ : [] },
23 'long captures sp'
24 );
25 t.deepEqual(
26 parse([ '--host=localhost', '--port=555' ]),
27 { host : 'localhost', port : 555, _ : [] },
28 'long captures eq'
29 );
30 t.end();
31});