@@ -107,13 +107,22 @@ describe('assert', function () {
107
107
it ( 'equal' , function ( ) {
108
108
var foo ;
109
109
assert . equal ( foo , undefined ) ;
110
+
111
+ if ( typeof Symbol === 'function' ) {
112
+ var sym = Symbol ( ) ;
113
+ assert . equal ( sym , sym ) ;
114
+ }
110
115
} ) ;
111
116
112
117
it ( 'typeof' , function ( ) {
113
118
assert . typeOf ( 'test' , 'string' ) ;
114
119
assert . typeOf ( true , 'boolean' ) ;
115
120
assert . typeOf ( 5 , 'number' ) ;
116
121
122
+ if ( typeof Symbol === 'function' ) {
123
+ assert . typeOf ( Symbol ( ) , 'symbol' ) ;
124
+ }
125
+
117
126
err ( function ( ) {
118
127
assert . typeOf ( 5 , 'string' ) ;
119
128
} , "expected 5 to be a string" ) ;
@@ -182,6 +191,12 @@ describe('assert', function () {
182
191
it ( 'notEqual' , function ( ) {
183
192
assert . notEqual ( 3 , 4 ) ;
184
193
194
+ if ( typeof Symbol === 'function' ) {
195
+ var sym1 = Symbol ( )
196
+ , sym2 = Symbol ( ) ;
197
+ assert . notEqual ( sym1 , sym2 ) ;
198
+ }
199
+
185
200
err ( function ( ) {
186
201
assert . notEqual ( 5 , 5 ) ;
187
202
} , "expected 5 to not equal 5" ) ;
@@ -190,6 +205,11 @@ describe('assert', function () {
190
205
it ( 'strictEqual' , function ( ) {
191
206
assert . strictEqual ( 'foo' , 'foo' ) ;
192
207
208
+ if ( typeof Symbol === 'function' ) {
209
+ var sym = Symbol ( ) ;
210
+ assert . strictEqual ( sym , sym ) ;
211
+ }
212
+
193
213
err ( function ( ) {
194
214
assert . strictEqual ( '5' , 5 ) ;
195
215
} , "expected \'5\' to equal 5" ) ;
@@ -198,6 +218,12 @@ describe('assert', function () {
198
218
it ( 'notStrictEqual' , function ( ) {
199
219
assert . notStrictEqual ( 5 , '5' ) ;
200
220
221
+ if ( typeof Symbol === 'function' ) {
222
+ var sym1 = Symbol ( )
223
+ , sym2 = Symbol ( ) ;
224
+ assert . notStrictEqual ( sym1 , sym2 ) ;
225
+ }
226
+
201
227
err ( function ( ) {
202
228
assert . notStrictEqual ( 5 , 5 ) ;
203
229
} , "expected 5 to not equal 5" ) ;
@@ -435,6 +461,12 @@ describe('assert', function () {
435
461
assert . include ( [ 1 , 2 , 3 ] , 3 ) ;
436
462
assert . include ( { a :1 , b :2 } , { b :2 } ) ;
437
463
464
+ if ( typeof Symbol === 'function' ) {
465
+ var sym1 = Symbol ( )
466
+ , sym2 = Symbol ( ) ;
467
+ assert . include ( [ sym1 , sym2 ] , sym1 ) ;
468
+ }
469
+
438
470
err ( function ( ) {
439
471
assert . include ( 'foobar' , 'baz' ) ;
440
472
} , "expected \'foobar\' to include \'baz\'" ) ;
@@ -460,6 +492,13 @@ describe('assert', function () {
460
492
assert . notInclude ( 'foobar' , 'baz' ) ;
461
493
assert . notInclude ( [ 1 , 2 , 3 ] , 4 ) ;
462
494
495
+ if ( typeof Symbol === 'function' ) {
496
+ var sym1 = Symbol ( )
497
+ , sym2 = Symbol ( )
498
+ , sym3 = Symbol ( ) ;
499
+ assert . notInclude ( [ sym1 , sym2 ] , sym3 ) ;
500
+ }
501
+
463
502
err ( function ( ) {
464
503
assert . notInclude ( true , true ) ;
465
504
} , "object tested must be an array, an object, or a string, but boolean given" ) ;
@@ -1256,6 +1295,10 @@ describe('assert', function () {
1256
1295
assert [ isNotExtensible ] ( 'foo' ) ;
1257
1296
assert [ isNotExtensible ] ( false ) ;
1258
1297
assert [ isNotExtensible ] ( undefined ) ;
1298
+
1299
+ if ( typeof Symbol === 'function' ) {
1300
+ assert [ isNotExtensible ] ( Symbol ( ) ) ;
1301
+ }
1259
1302
} ) ;
1260
1303
} ) ;
1261
1304
@@ -1276,6 +1319,10 @@ describe('assert', function () {
1276
1319
assert [ isSealed ] ( 'foo' ) ;
1277
1320
assert [ isSealed ] ( false ) ;
1278
1321
assert [ isSealed ] ( undefined ) ;
1322
+
1323
+ if ( typeof Symbol === 'function' ) {
1324
+ assert [ isSealed ] ( Symbol ( ) ) ;
1325
+ }
1279
1326
} ) ;
1280
1327
} ) ;
1281
1328
@@ -1330,6 +1377,10 @@ describe('assert', function () {
1330
1377
assert [ isFrozen ] ( 'foo' ) ;
1331
1378
assert [ isFrozen ] ( false ) ;
1332
1379
assert [ isFrozen ] ( undefined ) ;
1380
+
1381
+ if ( typeof Symbol === 'function' ) {
1382
+ assert [ isFrozen ] ( Symbol ( ) ) ;
1383
+ }
1333
1384
} ) ;
1334
1385
} ) ;
1335
1386
0 commit comments