11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_cirequire('../common'); 41cb0ef41Sopenharmony_ciconst assert = require('assert'); 51cb0ef41Sopenharmony_ciconst { spawnSync } = require('child_process'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ciconst results = new Set(); 81cb0ef41Sopenharmony_cifor (let i = 0; i < 10; i++) { 91cb0ef41Sopenharmony_ci const result = spawnSync(process.execPath, ['-p', 'Math.random()']); 101cb0ef41Sopenharmony_ci assert.strictEqual(result.status, 0); 111cb0ef41Sopenharmony_ci results.add(result.stdout.toString()); 121cb0ef41Sopenharmony_ci} 131cb0ef41Sopenharmony_ci// It's theoretically possible if _very_ unlikely to see some duplicates. 141cb0ef41Sopenharmony_ci// Therefore, don't expect that the size of the set is exactly 10 but do 151cb0ef41Sopenharmony_ci// assume it's > 1 because if you get 10 duplicates in a row you should 161cb0ef41Sopenharmony_ci// go out real quick and buy some lottery tickets, you lucky devil you! 171cb0ef41Sopenharmony_ciassert(results.size > 1); 18