2017-06-02 09:09:49 +02:00
|
|
|
'use strict';
|
|
|
|
|
2017-11-06 16:13:30 +01:00
|
|
|
// Check that spawn child doesn't create duplicated entries
|
|
|
|
require('../common');
|
2017-06-02 09:09:49 +02:00
|
|
|
const REPETITIONS = 2;
|
|
|
|
const assert = require('assert');
|
2017-11-06 16:13:30 +01:00
|
|
|
const fixtures = require('../common/fixtures');
|
|
|
|
const { spawnSync } = require('child_process');
|
|
|
|
const targetScript = fixtures.path('guess-hash-seed.js');
|
2017-06-02 09:09:49 +02:00
|
|
|
const seeds = [];
|
|
|
|
|
|
|
|
for (let i = 0; i < REPETITIONS; ++i) {
|
2017-11-06 16:13:30 +01:00
|
|
|
const seed = spawnSync(process.execPath, [targetScript], {
|
|
|
|
encoding: 'utf8'
|
|
|
|
}).stdout.trim();
|
2017-06-02 09:09:49 +02:00
|
|
|
seeds.push(seed);
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(`Seeds: ${seeds}`);
|
2017-11-06 16:13:30 +01:00
|
|
|
assert.strictEqual(new Set(seeds).size, seeds.length);
|