diff options
author | Johan Bergström <bugs@bergstroem.nu> | 2015-12-30 12:11:17 +1100 |
---|---|---|
committer | Johan Bergström <bugs@bergstroem.nu> | 2015-12-30 15:47:37 +1100 |
commit | 842e5a10ac59c826f875ef79e92d144e2655cc9a (patch) | |
tree | 87c710aa55518d2bd72737661986998d0e6cb087 /test/parallel | |
parent | 8132b942a74e9a3ebbc1e83159fb8777f93e83c6 (diff) | |
download | android-node-v8-842e5a10ac59c826f875ef79e92d144e2655cc9a.tar.gz android-node-v8-842e5a10ac59c826f875ef79e92d144e2655cc9a.tar.bz2 android-node-v8-842e5a10ac59c826f875ef79e92d144e2655cc9a.zip |
test: don't assume a certain folder structure
A few tests assumed that temp dirs always lived in the same
parent folder as fixtures. Make these use `common.tmpDir` instead.
PR-URL: https://github.com/nodejs/node/pull/3325
Reviewed-By: Joao Reis <reis@janeasystems.com>
Diffstat (limited to 'test/parallel')
-rw-r--r-- | test/parallel/test-fs-realpath.js | 18 | ||||
-rw-r--r-- | test/parallel/test-fs-symlink-dir-junction-relative.js | 3 |
2 files changed, 10 insertions, 11 deletions
diff --git a/test/parallel/test-fs-realpath.js b/test/parallel/test-fs-realpath.js index 12a4ce7b41..1e038c047b 100644 --- a/test/parallel/test-fs-realpath.js +++ b/test/parallel/test-fs-realpath.js @@ -273,14 +273,14 @@ function test_deep_symlink_mix(callback) { } /* - /tmp/node-test-realpath-f1 -> ../tmp/node-test-realpath-d1/foo - /tmp/node-test-realpath-d1 -> ../node-test-realpath-d2 - /tmp/node-test-realpath-d2/foo -> ../node-test-realpath-f2 + /tmp/node-test-realpath-f1 -> $tmpDir/node-test-realpath-d1/foo + /tmp/node-test-realpath-d1 -> $tmpDir/node-test-realpath-d2 + /tmp/node-test-realpath-d2/foo -> $tmpDir/node-test-realpath-f2 /tmp/node-test-realpath-f2 -> /node/test/fixtures/nested-index/one/realpath-c /node/test/fixtures/nested-index/one/realpath-c -> /node/test/fixtures/nested-index/two/realpath-c - /node/test/fixtures/nested-index/two/realpath-c -> ../../cycles/root.js + /node/test/fixtures/nested-index/two/realpath-c -> $tmpDir/cycles/root.js /node/test/fixtures/cycles/root.js (hard) */ var entry = tmp('node-test-realpath-f1'); @@ -289,16 +289,16 @@ function test_deep_symlink_mix(callback) { fs.mkdirSync(tmp('node-test-realpath-d2'), 0o700); try { [ - [entry, '../' + common.tmpDirName + '/node-test-realpath-d1/foo'], + [entry, common.tmpDir + '/node-test-realpath-d1/foo'], [tmp('node-test-realpath-d1'), - '../' + common.tmpDirName + '/node-test-realpath-d2'], + common.tmpDir + '/node-test-realpath-d2'], [tmp('node-test-realpath-d2/foo'), '../node-test-realpath-f2'], [tmp('node-test-realpath-f2'), fixturesAbsDir + - '/nested-index/one/realpath-c'], + '/nested-index/one/realpath-c'], [fixturesAbsDir + '/nested-index/one/realpath-c', fixturesAbsDir + - '/nested-index/two/realpath-c'], + '/nested-index/two/realpath-c'], [fixturesAbsDir + '/nested-index/two/realpath-c', - '../../../' + common.tmpDirName + '/cycles/root.js'] + common.tmpDir + '/cycles/root.js'] ].forEach(function(t) { try { fs.unlinkSync(t[0]); } catch (e) {} fs.symlinkSync(t[1], t[0]); diff --git a/test/parallel/test-fs-symlink-dir-junction-relative.js b/test/parallel/test-fs-symlink-dir-junction-relative.js index dcc4e989cc..cb3e5a464f 100644 --- a/test/parallel/test-fs-symlink-dir-junction-relative.js +++ b/test/parallel/test-fs-symlink-dir-junction-relative.js @@ -11,7 +11,7 @@ var expected_tests = 2; var linkPath1 = path.join(common.tmpDir, 'junction1'); var linkPath2 = path.join(common.tmpDir, 'junction2'); var linkTarget = path.join(common.fixturesDir); -var linkData = '../fixtures'; +var linkData = path.join(common.fixturesDir); common.refreshTmpDir(); @@ -42,4 +42,3 @@ function verifyLink(linkPath) { process.on('exit', function() { assert.equal(completed, expected_tests); }); - |