@@ -310,7 +310,19 @@ tape( 'the function returns a seeded pseudorandom number generator (array seed)'
310
310
311
311
tape ( 'attached to the returned function is the generator name' , function test ( t ) {
312
312
var mt19937 = factory ( ) ;
313
- t . equal ( mt19937 . NAME , 'mt19937' , 'has `NAME` property' ) ;
313
+ t . equal ( mt19937 . NAME , 'mt19937' , 'has property' ) ;
314
+ t . end ( ) ;
315
+ } ) ;
316
+
317
+ tape ( 'attached to the returned function is the minimum possible generated number' , function test ( t ) {
318
+ var mt19937 = factory ( ) ;
319
+ t . equal ( mt19937 . MIN , 1 , 'has property' ) ;
320
+ t . end ( ) ;
321
+ } ) ;
322
+
323
+ tape ( 'attached to the returned function is the maximum possible generated number' , function test ( t ) {
324
+ var mt19937 = factory ( ) ;
325
+ t . equal ( mt19937 . MAX , UINT32_MAX , 'has property' ) ;
314
326
t . end ( ) ;
315
327
} ) ;
316
328
@@ -323,7 +335,7 @@ tape( 'attached to the returned function is the generator seed (integer seed)',
323
335
} ) ;
324
336
actual = mt19937 . seed ;
325
337
326
- t . equal ( isUint32Array ( actual ) , true , 'has `seed` property' ) ;
338
+ t . equal ( isUint32Array ( actual ) , true , 'has property' ) ;
327
339
t . equal ( actual . length , 1 , 'has expected length' ) ;
328
340
t . equal ( actual [ 0 ] , 12345 , 'equal to provided seed' ) ;
329
341
t . end ( ) ;
@@ -341,40 +353,34 @@ tape( 'attached to the returned function is the generator seed (array seed)', fu
341
353
} ) ;
342
354
343
355
actual = mt19937 . seed ;
344
- t . equal ( isUint32Array ( actual ) , true , 'has `seed` property' ) ;
356
+ t . equal ( isUint32Array ( actual ) , true , 'has property' ) ;
345
357
for ( i = 0 ; i < seed . length ; i ++ ) {
346
358
t . equal ( actual [ i ] , seed [ i ] , 'returns expected value for word ' + i ) ;
347
359
}
348
360
t . end ( ) ;
349
361
} ) ;
350
362
351
- tape ( 'attached to the returned function is the minimum possible generated number' , function test ( t ) {
352
- var mt19937 = factory ( ) ;
353
- t . equal ( mt19937 . MIN , 1 , 'has `MIN` property' ) ;
354
- t . end ( ) ;
355
- } ) ;
356
-
357
- tape ( 'attached to the returned function is the maximum possible generated number' , function test ( t ) {
363
+ tape ( 'attached to the returned function is the generator seed length' , function test ( t ) {
358
364
var mt19937 = factory ( ) ;
359
- t . equal ( mt19937 . MAX , UINT32_MAX , 'has `MAX` property' ) ;
365
+ t . equal ( typeof mt19937 . seedLength , 'number' , 'has property' ) ;
360
366
t . end ( ) ;
361
367
} ) ;
362
368
363
369
tape ( 'attached to the returned function is the generator state' , function test ( t ) {
364
370
var mt19937 = factory ( ) ;
365
- t . equal ( isUint32Array ( mt19937 . state ) , true , 'has `state` property' ) ;
371
+ t . equal ( isUint32Array ( mt19937 . state ) , true , 'has property' ) ;
366
372
t . end ( ) ;
367
373
} ) ;
368
374
369
375
tape ( 'attached to the returned function is the generator state length' , function test ( t ) {
370
376
var mt19937 = factory ( ) ;
371
- t . equal ( typeof mt19937 . stateLength , 'number' , 'has `stateLength` property' ) ;
377
+ t . equal ( typeof mt19937 . stateLength , 'number' , 'has property' ) ;
372
378
t . end ( ) ;
373
379
} ) ;
374
380
375
381
tape ( 'attached to the returned function is the generator state size' , function test ( t ) {
376
382
var mt19937 = factory ( ) ;
377
- t . equal ( typeof mt19937 . byteLength , 'number' , 'has `byteLength` property' ) ;
383
+ t . equal ( typeof mt19937 . byteLength , 'number' , 'has property' ) ;
378
384
t . end ( ) ;
379
385
} ) ;
380
386
@@ -449,7 +455,19 @@ tape( 'attached to the returned function is a `normalized` method for generating
449
455
450
456
tape ( 'attached to the `normalized` method is the generator name' , function test ( t ) {
451
457
var mt19937 = factory ( ) ;
452
- t . equal ( mt19937 . normalized . NAME , 'mt19937' , 'has `NAME` property' ) ;
458
+ t . equal ( mt19937 . normalized . NAME , 'mt19937' , 'has property' ) ;
459
+ t . end ( ) ;
460
+ } ) ;
461
+
462
+ tape ( 'attached to the `normalized` method is the minimum possible generated number' , function test ( t ) {
463
+ var mt19937 = factory ( ) ;
464
+ t . equal ( mt19937 . normalized . MIN , 0.0 , 'has property' ) ;
465
+ t . end ( ) ;
466
+ } ) ;
467
+
468
+ tape ( 'attached to the `normalized` method is the maximum possible generated number' , function test ( t ) {
469
+ var mt19937 = factory ( ) ;
470
+ t . equal ( mt19937 . normalized . MAX , FLOAT64_MAX_SAFE_INTEGER / ( FLOAT64_MAX_SAFE_INTEGER + 1 ) , 'has property' ) ;
453
471
t . end ( ) ;
454
472
} ) ;
455
473
@@ -462,7 +480,7 @@ tape( 'attached to the `normalized` method is the generator seed (integer seed)'
462
480
} ) ;
463
481
actual = mt19937 . normalized . seed ;
464
482
465
- t . equal ( isUint32Array ( actual ) , true , 'has `seed` property' ) ;
483
+ t . equal ( isUint32Array ( actual ) , true , 'has property' ) ;
466
484
t . equal ( actual . length , 1 , 'has expected length' ) ;
467
485
t . equal ( actual [ 0 ] , 12345 , 'equal to provided seed' ) ;
468
486
t . end ( ) ;
@@ -480,40 +498,34 @@ tape( 'attached to the `normalized` method is the generator seed (array seed)',
480
498
} ) ;
481
499
482
500
actual = mt19937 . normalized . seed ;
483
- t . equal ( isUint32Array ( actual ) , true , 'has `seed` property' ) ;
501
+ t . equal ( isUint32Array ( actual ) , true , 'has property' ) ;
484
502
for ( i = 0 ; i < seed . length ; i ++ ) {
485
503
t . equal ( actual [ i ] , seed [ i ] , 'returns expected value for word ' + i ) ;
486
504
}
487
505
t . end ( ) ;
488
506
} ) ;
489
507
490
- tape ( 'attached to the `normalized` method is the minimum possible generated number' , function test ( t ) {
491
- var mt19937 = factory ( ) ;
492
- t . equal ( mt19937 . normalized . MIN , 0.0 , 'has `MIN` property' ) ;
493
- t . end ( ) ;
494
- } ) ;
495
-
496
- tape ( 'attached to the `normalized` method is the maximum possible generated number' , function test ( t ) {
508
+ tape ( 'attached to the `normalized` method is the generator seed length' , function test ( t ) {
497
509
var mt19937 = factory ( ) ;
498
- t . equal ( mt19937 . normalized . MAX , FLOAT64_MAX_SAFE_INTEGER / ( FLOAT64_MAX_SAFE_INTEGER + 1 ) , 'has `MAX` property' ) ;
510
+ t . equal ( typeof mt19937 . normalized . seedLength , 'number' , 'has property' ) ;
499
511
t . end ( ) ;
500
512
} ) ;
501
513
502
514
tape ( 'attached to the `normalized` method is the generator state' , function test ( t ) {
503
515
var mt19937 = factory ( ) ;
504
- t . equal ( isUint32Array ( mt19937 . normalized . state ) , true , 'has `state` property' ) ;
516
+ t . equal ( isUint32Array ( mt19937 . normalized . state ) , true , 'has property' ) ;
505
517
t . end ( ) ;
506
518
} ) ;
507
519
508
520
tape ( 'attached to the `normalized` method is the generator state size' , function test ( t ) {
509
521
var mt19937 = factory ( ) ;
510
- t . equal ( typeof mt19937 . normalized . byteLength , 'number' , 'has `byteLength` property' ) ;
522
+ t . equal ( typeof mt19937 . normalized . byteLength , 'number' , 'has property' ) ;
511
523
t . end ( ) ;
512
524
} ) ;
513
525
514
526
tape ( 'attached to the `normalized` method is the generator state length' , function test ( t ) {
515
527
var mt19937 = factory ( ) ;
516
- t . equal ( typeof mt19937 . normalized . stateLength , 'number' , 'has `stateLength` property' ) ;
528
+ t . equal ( typeof mt19937 . normalized . stateLength , 'number' , 'has property' ) ;
517
529
t . end ( ) ;
518
530
} ) ;
519
531
0 commit comments