diff options
| author | Marak <[email protected]> | 2018-10-10 12:52:25 -0400 |
|---|---|---|
| committer | Marak <[email protected]> | 2018-10-10 12:52:25 -0400 |
| commit | c852cdf5ba5253617fffc0261fa6c62e77a200a4 (patch) | |
| tree | 8b9319da375ef8a4f1afdfbc725e9160cda9f296 /test | |
| parent | be8cd96541ba277941f4489fba27fc96296ed15c (diff) | |
| download | faker-c852cdf5ba5253617fffc0261fa6c62e77a200a4.tar.xz faker-c852cdf5ba5253617fffc0261fa6c62e77a200a4.zip | |
[fix] Mersenne Twister seed_array #712
Diffstat (limited to 'test')
| -rw-r--r-- | test/random.unit.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/random.unit.js b/test/random.unit.js index f566a7ec..e3befcdc 100644 --- a/test/random.unit.js +++ b/test/random.unit.js @@ -78,11 +78,24 @@ describe("random.js", function () { assert.equal(opts.max, max); }); - it('should return deterministic results when seeded', function() { + it('should return deterministic results when seeded with integer', function() { faker.seed(100); var name = faker.name.findName(); assert.equal(name, 'Eva Jenkins'); }) + + it('should return deterministic results when seeded with array - one element', function() { + faker.seed([10]); + var name = faker.name.findName(); + assert.equal(name, 'Duane Kub'); + }) + + it('should return deterministic results when seeded with array - multiple elements', function() { + faker.seed([10, 100, 1000]); + var name = faker.name.findName(); + assert.equal(name, 'Alma Shanahan'); + }) + }); describe("float", function() { |
