11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci// Flags: --expose-internals 31cb0ef41Sopenharmony_cirequire('../common'); 41cb0ef41Sopenharmony_ciconst { getOptionValue } = require('internal/options'); 51cb0ef41Sopenharmony_ciconst assert = require('assert'); 61cb0ef41Sopenharmony_ciconst cp = require('child_process'); 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ciconst expected_redirect_value = 'foó'; 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ciif (process.argv.length === 2) { 111cb0ef41Sopenharmony_ci const NODE_OPTIONS = `--redirect-warnings=${expected_redirect_value}`; 121cb0ef41Sopenharmony_ci const result = cp.spawnSync(process.argv0, 131cb0ef41Sopenharmony_ci ['--expose-internals', __filename, 'test'], 141cb0ef41Sopenharmony_ci { 151cb0ef41Sopenharmony_ci env: { 161cb0ef41Sopenharmony_ci ...process.env, 171cb0ef41Sopenharmony_ci NODE_OPTIONS 181cb0ef41Sopenharmony_ci }, 191cb0ef41Sopenharmony_ci stdio: 'inherit' 201cb0ef41Sopenharmony_ci }); 211cb0ef41Sopenharmony_ci assert.strictEqual(result.status, 0); 221cb0ef41Sopenharmony_ci} else { 231cb0ef41Sopenharmony_ci const redirect_value = getOptionValue('--redirect-warnings'); 241cb0ef41Sopenharmony_ci console.log(`--redirect-warings=${redirect_value}`); 251cb0ef41Sopenharmony_ci assert.strictEqual(redirect_value, expected_redirect_value); 261cb0ef41Sopenharmony_ci} 27