8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9222689 commit 5002a71Copy full SHA for 5002a71
test/parallel/test-assert.js
@@ -27,39 +27,46 @@ assert.doesNotThrow(makeBlock(a.ok, true),
27
28
assert.doesNotThrow(makeBlock(a.ok, 'test'), 'ok(\'test\')');
29
30
-assert.throws(makeBlock(a.equal, true, false), a.AssertionError, 'equal');
+assert.throws(makeBlock(a.equal, true, false),
31
+ a.AssertionError, 'equal(true, false)');
32
-assert.doesNotThrow(makeBlock(a.equal, null, null), 'equal');
33
+assert.doesNotThrow(makeBlock(a.equal, null, null),
34
+ 'equal(null, null)');
35
-assert.doesNotThrow(makeBlock(a.equal, undefined, undefined), 'equal');
36
+assert.doesNotThrow(makeBlock(a.equal, undefined, undefined),
37
+ 'equal(undefined, undefined)');
38
-assert.doesNotThrow(makeBlock(a.equal, null, undefined), 'equal');
39
+assert.doesNotThrow(makeBlock(a.equal, null, undefined),
40
+ 'equal(null, undefined)');
41
-assert.doesNotThrow(makeBlock(a.equal, true, true), 'equal');
42
+assert.doesNotThrow(makeBlock(a.equal, true, true), 'equal(true, true)');
43
-assert.doesNotThrow(makeBlock(a.equal, 2, '2'), 'equal');
44
+assert.doesNotThrow(makeBlock(a.equal, 2, '2'), 'equal(2, \'2\')');
45
-assert.doesNotThrow(makeBlock(a.notEqual, true, false), 'notEqual');
46
+assert.doesNotThrow(makeBlock(a.notEqual, true, false),
47
+ 'notEqual(true, false)');
48
49
assert.throws(makeBlock(a.notEqual, true, true),
- a.AssertionError, 'notEqual');
50
+ a.AssertionError, 'notEqual(true, true)');
51
52
assert.throws(makeBlock(a.strictEqual, 2, '2'),
- a.AssertionError, 'strictEqual');
53
+ a.AssertionError, 'strictEqual(2, \'2\')');
54
55
assert.throws(makeBlock(a.strictEqual, null, undefined),
56
+ a.AssertionError, 'strictEqual(null, undefined)');
57
-assert.doesNotThrow(makeBlock(a.notStrictEqual, 2, '2'), 'notStrictEqual');
58
+assert.doesNotThrow(makeBlock(a.notStrictEqual, 2, '2'),
59
+ 'notStrictEqual(2, \'2\')');
60
61
// deepEquals joy!
62
// 7.2
63
assert.doesNotThrow(makeBlock(a.deepEqual, new Date(2000, 3, 14),
- new Date(2000, 3, 14)), 'deepEqual date');
64
+ new Date(2000, 3, 14)),
65
+ 'deepEqual(new Date(2000, 3, 14), new Date(2000, 3, 14))');
66
67
assert.throws(makeBlock(a.deepEqual, new Date(), new Date(2000, 3, 14)),
68
a.AssertionError,
- 'deepEqual date');
69
+ 'deepEqual(new Date(), new Date(2000, 3, 14))');
70
71
// 7.3
72
assert.doesNotThrow(makeBlock(a.deepEqual, /a/, /a/));
@@ -81,11 +88,11 @@ assert.throws(makeBlock(a.deepEqual, /a/igm, /a/im));
81
88
82
89
83
90
// 7.4
84
-assert.doesNotThrow(makeBlock(a.deepEqual, 4, '4'), 'deepEqual == check');
85
-assert.doesNotThrow(makeBlock(a.deepEqual, true, 1), 'deepEqual == check');
91
+assert.doesNotThrow(makeBlock(a.deepEqual, 4, '4'), 'deepEqual(4, \'4\')');
92
+assert.doesNotThrow(makeBlock(a.deepEqual, true, 1), 'deepEqual(true, 1)');
86
93
assert.throws(makeBlock(a.deepEqual, 4, '5'),
87
94
- 'deepEqual == check');
95
+ 'deepEqual( 4, \'5\')');
96
97
// 7.5
98
// having the same number of owned properties && the same set of keys
@@ -156,11 +163,13 @@ assert.doesNotThrow(makeBlock(a.deepEqual, new Boolean(true), {}),
156
163
157
164
//deepStrictEqual
158
165
assert.doesNotThrow(makeBlock(a.deepStrictEqual, new Date(2000, 3, 14),
159
- new Date(2000, 3, 14)), 'deepStrictEqual date');
166
167
+ 'deepStrictEqual(new Date(2000, 3, 14),\
168
+ new Date(2000, 3, 14))');
160
169
161
170
assert.throws(makeBlock(a.deepStrictEqual, new Date(), new Date(2000, 3, 14)),
162
171
- 'deepStrictEqual date');
172
+ 'deepStrictEqual(new Date(), new Date(2000, 3, 14))');
173
174
// 7.3 - strict
175
assert.doesNotThrow(makeBlock(a.deepStrictEqual, /a/, /a/));
@@ -183,15 +192,15 @@ assert.throws(makeBlock(a.deepStrictEqual, /a/igm, /a/im));
183
192
// 7.4 - strict
184
193
assert.throws(makeBlock(a.deepStrictEqual, 4, '4'),
185
194
186
- 'deepStrictEqual === check');
195
+ 'deepStrictEqual(4, \'4\')');
187
196
188
197
assert.throws(makeBlock(a.deepStrictEqual, true, 1),
189
198
190
199
+ 'deepStrictEqual(true, 1)');
191
200
201
assert.throws(makeBlock(a.deepStrictEqual, 4, '5'),
202
203
+ 'deepStrictEqual(4, \'5\')');
204
205
// 7.5 - strict
206