From: Carter Allen Date: Mon, 27 Dec 2010 00:32:04 +0000 (-0700) Subject: Fix tests when spaces are in path X-Git-Tag: v0.3.7~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ad93ab573dbe9555db0c1b9ab26de6672e7cb07;p=platform%2Fupstream%2Fnodejs.git Fix tests when spaces are in path --- diff --git a/test/simple/test-cli-eval.js b/test/simple/test-cli-eval.js index ec4cf32..c4e9247 100644 --- a/test/simple/test-cli-eval.js +++ b/test/simple/test-cli-eval.js @@ -1,7 +1,7 @@ assert = require('assert'); child = require('child_process'); -nodejs = process.execPath; +nodejs = '"' + process.execPath + '"'; if (module.parent) { // signal we've been loaded as a module diff --git a/test/simple/test-error-reporting.js b/test/simple/test-error-reporting.js index 6c9ea5e..bdfab22 100644 --- a/test/simple/test-error-reporting.js +++ b/test/simple/test-error-reporting.js @@ -6,7 +6,7 @@ var path = require('path'); 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); diff --git a/test/simple/test-http-curl-chunk-problem.js b/test/simple/test-http-curl-chunk-problem.js index 30b8a98..654053b 100644 --- a/test/simple/test-http-curl-chunk-problem.js +++ b/test/simple/test-http-curl-chunk-problem.js @@ -22,7 +22,7 @@ function maybeMakeRequest() { } -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(); diff --git a/test/simple/test-pipe-head.js b/test/simple/test-pipe-head.js index 5fe595d..a77e739 100644 --- a/test/simple/test-pipe-head.js +++ b/test/simple/test-pipe-head.js @@ -7,7 +7,7 @@ var join = require('path').join; 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; diff --git a/test/simple/test-stdin-from-file.js b/test/simple/test-stdin-from-file.js index 40e9093..b429fb7 100644 --- a/test/simple/test-stdin-from-file.js +++ b/test/simple/test-stdin-from-file.js @@ -7,7 +7,7 @@ var fs = require('fs'); 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年存在于岭南地区的一个国家,国都位于番禺,' + diff --git a/test/simple/test-stdout-to-file.js b/test/simple/test-stdout-to-file.js index a8d5357..4420658 100644 --- a/test/simple/test-stdout-to-file.js +++ b/test/simple/test-stdout-to-file.js @@ -9,13 +9,13 @@ var scriptBuffer = path.join(common.fixturesDir, 'print-chars-from-buffer.js'); 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);