summaryrefslogtreecommitdiff
path: root/test/pummel/test-hash-seed.js
blob: fd59bbe5e0653cbf598513b369859b2dec0457a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'use strict';

// Check that spawn child doesn't create duplicated entries
require('../common');
const REPETITIONS = 2;
const assert = require('assert');
const fixtures = require('../common/fixtures');
const { spawnSync } = require('child_process');
const targetScript = fixtures.path('guess-hash-seed.js');
const seeds = [];

for (let i = 0; i < REPETITIONS; ++i) {
  const seed = spawnSync(process.execPath, [targetScript], {
    encoding: 'utf8'
  }).stdout.trim();
  seeds.push(seed);
}

console.log(`Seeds: ${seeds}`);
assert.strictEqual(new Set(seeds).size, seeds.length);