var common = require('../common');
var assert = require('assert');
var os = require('os');
-var util = require('util');
var spawnSync = require('child_process').spawnSync;
var args = [
'-e',
- util.format('console.log("%s"); console.error("%s");', msgOut, msgErr)
+ `console.log("${msgOut}"); console.error("${msgErr}");`
];
var ret;
'use strict';
-var common = require('../common');
-var assert = require('assert');
+const common = require('../common');
+const assert = require('assert');
-var spawnSync = require('child_process').spawnSync;
+const spawnSync = require('child_process').spawnSync;
// Echo does different things on Windows and Unix, but in both cases, it does
// more-or-less nothing if there are no parameters
-var ret = spawnSync('sleep', ['0']);
+const ret = spawnSync('sleep', ['0']);
assert.strictEqual(ret.status, 0, 'exit status should be zero');
// Error test when command does not exist
-var ret_err = spawnSync('command_does_not_exist', ['bar']).error;
+const ret_err = spawnSync('command_does_not_exist', ['bar']).error;
assert.strictEqual(ret_err.code, 'ENOENT');
assert.strictEqual(ret_err.errno, 'ENOENT');
'use strict';
-var common = require('../common'),
- assert = require('assert'),
- spawn = require('child_process').spawn,
- os = require('os'),
- util = require('util');
+const common = require('../common');
+const assert = require('assert');
+const spawn = require('child_process').spawn;
+const os = require('os');
var args = [
'-e',
var data = '';
child.stdout.on('data', function(d) { data += d; });
-child.stdin.end(util.format("e.setPrompt('%s');%s", p, os.EOL));
+child.stdin.end(`e.setPrompt("${p}");${os.EOL}`);
child.on('close', function(code, signal) {
assert.strictEqual(code, 0);
'use strict';
var common = require('../common');
var assert = require('assert');
-var util = require('util');
var os = require('os');
var execSync = require('child_process').execSync;
var start = Date.now();
var err;
var caught = false;
+
try
{
- var cmd = util.format('"%s" -e "setTimeout(function(){}, %d);"',
- process.execPath, SLEEP);
+ var cmd = `"${process.execPath}" -e "setTimeout(function(){}, ${SLEEP});"`;
var ret = execSync(cmd, {timeout: TIMER});
} catch (e) {
caught = true;
var msgBuf = new Buffer(msg + '\n');
// console.log ends every line with just '\n', even on Windows.
-cmd = util.format('"%s" -e "console.log(\'%s\');"', process.execPath, msg);
+
+cmd = `"${process.execPath}" -e "console.log(\'${msg}\');"`;
var ret = execSync(cmd);
var args = [
'-e',
- util.format('console.log("%s");', msg)
+ `console.log("${msg}");`
];
ret = execFileSync(process.execPath, args);