diff options
author | Christian Tellnes <christian@tellnes.no> | 2015-02-06 23:27:22 +0100 |
---|---|---|
committer | Chris Dickinson <christopher.s.dickinson@gmail.com> | 2015-04-28 14:38:14 -0700 |
commit | b57cc51d8d3f4ad279591ae8fa6584ee22773b97 (patch) | |
tree | fa4a560d579c949c4e9cae4838ac92a120ee8e47 /test/parallel/test-os.js | |
parent | 1bcdf46ca750a1e2ede7824ad5359d501675c430 (diff) | |
download | android-node-v8-b57cc51d8d3f4ad279591ae8fa6584ee22773b97.tar.gz android-node-v8-b57cc51d8d3f4ad279591ae8fa6584ee22773b97.tar.bz2 android-node-v8-b57cc51d8d3f4ad279591ae8fa6584ee22773b97.zip |
os: remove trailing slash from os.tmpdir()
This commit makes `os.tmpdir()` behave consistently on all platforms. It
changes `os.tmpdir()` to always return a path without trailing slash.
Semver: major
Fixes: https://github.com/iojs/io.js/issues/715
PR-URL: https://github.com/iojs/io.js/pull/747
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'test/parallel/test-os.js')
-rw-r--r-- | test/parallel/test-os.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/parallel/test-os.js b/test/parallel/test-os.js index ae57353435..b5f39973a6 100644 --- a/test/parallel/test-os.js +++ b/test/parallel/test-os.js @@ -13,6 +13,8 @@ if (process.platform === 'win32') { process.env.TMP = ''; var expected = (process.env.SystemRoot || process.env.windir) + '\\temp'; assert.equal(os.tmpdir(), expected); + process.env.TEMP = '\\temp\\'; + assert.equal(os.tmpdir(), '\\temp'); } else { assert.equal(os.tmpdir(), '/tmpdir'); process.env.TMPDIR = ''; @@ -21,6 +23,8 @@ if (process.platform === 'win32') { assert.equal(os.tmpdir(), '/temp'); process.env.TEMP = ''; assert.equal(os.tmpdir(), '/tmp'); + process.env.TMPDIR = '/tmpdir/'; + assert.equal(os.tmpdir(), '/tmpdir'); } var endianness = os.endianness(); |