Skip to content

Commit ebd2844

Browse files
author
James Halliday
committed
odd that eql doesn't check types careflly
1 parent fd854b0 commit ebd2844

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

test/parse.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,84 @@
11
var optimist = require('optimist');
22

33
exports['short boolean'] = function (assert) {
4-
assert.deepEqual(
4+
assert.eql(
55
optimist.parse([ '-b' ]),
66
{ b : true, _ : [], $0 : 'expresso' }
77
);
88
};
99

1010
exports['long boolean'] = function (assert) {
11-
assert.deepEqual(
11+
assert.eql(
1212
optimist.parse([ '--bool' ]),
1313
{ bool : true, _ : [], $0 : 'expresso' }
1414
);
1515
};
1616

1717
exports.bare = function (assert) {
18-
assert.deepEqual(
18+
assert.eql(
1919
optimist.parse([ 'foo', 'bar', 'baz' ]),
2020
{ _ : [ 'foo', 'bar', 'baz' ], $0 : 'expresso' }
2121
);
2222
};
2323

2424
exports['short group'] = function (assert) {
25-
assert.deepEqual(
25+
assert.eql(
2626
optimist.parse([ '-cats' ]),
2727
{ c : true, a : true, t : true, s : true, _ : [], $0 : 'expresso' }
2828
);
2929
};
3030

3131
exports['short group next'] = function (assert) {
32-
assert.deepEqual(
32+
assert.eql(
3333
optimist.parse([ '-cats', 'meow' ]),
3434
{ c : true, a : true, t : true, s : 'meow', _ : [], $0 : 'expresso' }
3535
);
3636
};
3737

3838
exports['short capture'] = function (assert) {
39-
assert.deepEqual(
39+
assert.eql(
4040
optimist.parse([ '-h', 'localhost' ]),
4141
{ h : 'localhost', _ : [], $0 : 'expresso' }
4242
);
4343
};
4444

4545
exports['short captures'] = function (assert) {
46-
assert.deepEqual(
46+
assert.eql(
4747
optimist.parse([ '-h', 'localhost', '-p', '555' ]),
48-
{ h : 'localhost', p : '555', _ : [], $0 : 'expresso' }
48+
{ h : 'localhost', p : 555, _ : [], $0 : 'expresso' }
4949
);
5050
};
5151

5252
exports['long capture sp'] = function (assert) {
53-
assert.deepEqual(
53+
assert.eql(
5454
optimist.parse([ '--pow', 'xixxle' ]),
5555
{ pow : 'xixxle', _ : [], $0 : 'expresso' }
5656
);
5757
};
5858

5959
exports['long capture eq'] = function (assert) {
60-
assert.deepEqual(
60+
assert.eql(
6161
optimist.parse([ '--pow=xixxle' ]),
6262
{ pow : 'xixxle', _ : [], $0 : 'expresso' }
6363
);
6464
};
6565

6666
exports['long captures sp'] = function (assert) {
67-
assert.deepEqual(
67+
assert.eql(
6868
optimist.parse([ '--host', 'localhost', '--port', '555' ]),
69-
{ host : 'localhost', port : '555', _ : [], $0 : 'expresso' }
69+
{ host : 'localhost', port : 555, _ : [], $0 : 'expresso' }
7070
);
7171
};
7272

7373
exports['long captures eq'] = function (assert) {
74-
assert.deepEqual(
74+
assert.eql(
7575
optimist.parse([ '--host=localhost', '--port=555' ]),
76-
{ host : 'localhost', port : '555', _ : [], $0 : 'expresso' }
76+
{ host : 'localhost', port : 555, _ : [], $0 : 'expresso' }
7777
);
7878
};
7979

8080
exports['mixed short bool and capture'] = function (assert) {
81-
assert.deepEqual(
81+
assert.eql(
8282
optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
8383
{
8484
f : true, p : 555, h : 'localhost',
@@ -88,7 +88,7 @@ exports['mixed short bool and capture'] = function (assert) {
8888
};
8989

9090
exports['short and long'] = function (assert) {
91-
assert.deepEqual(
91+
assert.eql(
9292
optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
9393
{
9494
f : true, p : 555, h : 'localhost',
@@ -98,21 +98,21 @@ exports['short and long'] = function (assert) {
9898
};
9999

100100
exports.no = function (assert) {
101-
assert.deepEqual(
101+
assert.eql(
102102
optimist.parse([ '--no-moo' ]),
103103
{ moo : false, _ : [], $0 : 'expresso' }
104104
);
105105
};
106106

107107
exports.multi = function (assert) {
108-
assert.deepEqual(
108+
assert.eql(
109109
optimist.parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]),
110110
{ v : ['a','b','c'], _ : [], $0 : 'expresso' }
111111
);
112112
};
113113

114114
exports.comprehensive = function (assert) {
115-
assert.deepEqual(
115+
assert.eql(
116116
optimist.parse([
117117
'--name=meowmers', 'bare', '-cats', 'woo',
118118
'-h', 'awesome', '--multi=quux',

0 commit comments

Comments
 (0)