diff options
author | Sakthipriyan Vairamani <thechargingvolcano@gmail.com> | 2015-07-29 17:18:04 +0530 |
---|---|---|
committer | Sakthipriyan Vairamani <thechargingvolcano@gmail.com> | 2015-07-31 00:29:36 +0530 |
commit | d5ab92bcc1f0ddf7ea87a8322824a688dfd43bf5 (patch) | |
tree | 84fd79f5ed48e08077d0f0b347147be38daf82df /test/parallel/test-fs-chmod.js | |
parent | fa98b97171d9b8519bdbf5d9f8dbd8639ac3c050 (diff) | |
download | android-node-v8-d5ab92bcc1f0ddf7ea87a8322824a688dfd43bf5.tar.gz android-node-v8-d5ab92bcc1f0ddf7ea87a8322824a688dfd43bf5.tar.bz2 android-node-v8-d5ab92bcc1f0ddf7ea87a8322824a688dfd43bf5.zip |
test: use common.isWindows consistently
In the tests, we use "process.platform === 'win32'" in some places.
This patch replaces them with the "common.isWindows" for consistency.
PR-URL: https://github.com/nodejs/io.js/pull/2269
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'test/parallel/test-fs-chmod.js')
-rw-r--r-- | test/parallel/test-fs-chmod.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/parallel/test-fs-chmod.js b/test/parallel/test-fs-chmod.js index 5d4a8a2b9c..11c8bb6168 100644 --- a/test/parallel/test-fs-chmod.js +++ b/test/parallel/test-fs-chmod.js @@ -7,7 +7,6 @@ var got_error = false; var success_count = 0; var mode_async; var mode_sync; -var is_windows = process.platform === 'win32'; // Need to hijack fs.open/close to make sure that things // get closed once they're opened. @@ -44,7 +43,7 @@ function closeSync() { // On Windows chmod is only able to manipulate read-only bit -if (is_windows) { +if (common.isWindows) { mode_async = 0o400; // read-only mode_sync = 0o600; // read-write } else { @@ -61,14 +60,14 @@ fs.chmod(file1, mode_async.toString(8), function(err) { } else { console.log(fs.statSync(file1).mode); - if (is_windows) { + if (common.isWindows) { assert.ok((fs.statSync(file1).mode & 0o777) & mode_async); } else { assert.equal(mode_async, fs.statSync(file1).mode & 0o777); } fs.chmodSync(file1, mode_sync); - if (is_windows) { + if (common.isWindows) { assert.ok((fs.statSync(file1).mode & 0o777) & mode_sync); } else { assert.equal(mode_sync, fs.statSync(file1).mode & 0o777); @@ -89,14 +88,14 @@ fs.open(file2, 'a', function(err, fd) { } else { console.log(fs.fstatSync(fd).mode); - if (is_windows) { + if (common.isWindows) { assert.ok((fs.fstatSync(fd).mode & 0o777) & mode_async); } else { assert.equal(mode_async, fs.fstatSync(fd).mode & 0o777); } fs.fchmodSync(fd, mode_sync); - if (is_windows) { + if (common.isWindows) { assert.ok((fs.fstatSync(fd).mode & 0o777) & mode_sync); } else { assert.equal(mode_sync, fs.fstatSync(fd).mode & 0o777); |