From aeb124f7f3625bff31d88dc3e42ad621028febf6 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 5 Dec 2011 06:37:18 +0100 Subject: [PATCH] test: create test file in temp dir --- test/simple/test-fs-long-path.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/simple/test-fs-long-path.js b/test/simple/test-fs-long-path.js index dfd68802a9..2ae80d0edb 100644 --- a/test/simple/test-fs-long-path.js +++ b/test/simple/test-fs-long-path.js @@ -19,6 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +var common = require('../common'); var fs = require('fs'); var path = require('path'); var assert = require('assert'); @@ -26,9 +27,8 @@ var assert = require('assert'); var successes = 0; // make a path that will be at least 260 chars long. -var cwd = process.cwd(); -var fileNameLen = Math.max(260 - cwd.length - 1, 1); -var fileName = new Array(fileNameLen + 1).join('x'); +var fileNameLen = Math.max(260 - common.tmpDir.length - 1, 1); +var fileName = path.join(common.tmpDir, new Array(fileNameLen + 1).join('x')); var fullPath = path.resolve(fileName); console.log({ filenameLength: fileName.length,