assert = require('assert');
child = require('child_process');
-nodejs = process.execPath;
+nodejs = '"' + process.execPath + '"';
if (module.parent) {
// signal we've been loaded as a module
var exits = 0;
function errExec(script, callback) {
- var cmd = process.argv[0] + ' ' + path.join(common.fixturesDir, script);
+ var cmd = '"' + process.argv[0] + '" "' + path.join(common.fixturesDir, script) + '"';
return exec(cmd, function(err, stdout, stderr) {
// There was some error
assert.ok(err);
}
-cp.exec('dd if=/dev/zero of=' + filename + ' bs=1024 count=10240',
+cp.exec('dd if=/dev/zero of="' + filename + '" bs=1024 count=10240',
function(err, stdout, stderr) {
if (err) throw err;
maybeMakeRequest();
var nodePath = process.argv[0];
var script = join(common.fixturesDir, 'print-10-lines.js');
-var cmd = nodePath + ' ' + script + ' | head -2';
+var cmd = '"' + nodePath + '" "' + script + '" | head -2';
var finished = false;
var stdoutScript = join(common.fixturesDir, 'echo.js');
var tmpFile = join(common.fixturesDir, 'stdin.txt');
-var cmd = process.argv[0] + ' ' + stdoutScript + ' < ' + tmpFile;
+var cmd = '"' + process.argv[0] + '" "' + stdoutScript + '" < "' + tmpFile + '"';
var string = 'abc\nümlaut.\nsomething else\n' +
'南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,' +
var tmpFile = path.join(common.fixturesDir, 'stdout.txt');
function test(size, useBuffer, cb) {
- var cmd = process.argv[0] +
+ var cmd = '"' + process.argv[0] + '"' +
' ' +
- (useBuffer ? scriptBuffer : scriptString) +
+ '"' + (useBuffer ? scriptBuffer : scriptString) + '"' +
' ' +
size +
' > ' +
- tmpFile;
+ '"' + tmpFile + '"';
try {
fs.unlinkSync(tmpFile);