mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 06:08:50 +02:00
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>
This commit is contained in:
parent
fa98b97171
commit
d5ab92bcc1
66 changed files with 114 additions and 132 deletions
|
@ -14,7 +14,7 @@ var accessErrorFired = false;
|
|||
|
||||
var emptyTxt;
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
if (common.isWindows) {
|
||||
// on Win, common.PIPE will be a named pipe, so we use an existing empty
|
||||
// file instead
|
||||
emptyTxt = path.join(common.fixturesDir, 'empty.txt');
|
||||
|
@ -58,7 +58,7 @@ noEntSocketClient.on('error', function(err) {
|
|||
|
||||
|
||||
// On Windows or when running as root, a chmod has no effect on named pipes
|
||||
if (process.platform !== 'win32' && process.getuid() !== 0) {
|
||||
if (!common.isWindows && process.getuid() !== 0) {
|
||||
// Trying to connect to a socket one has no access to should result in EACCES
|
||||
var accessServer = net.createServer(function() {
|
||||
assert.ok(false);
|
||||
|
@ -83,7 +83,7 @@ if (process.platform !== 'win32' && process.getuid() !== 0) {
|
|||
process.on('exit', function() {
|
||||
assert.ok(notSocketErrorFired);
|
||||
assert.ok(noEntErrorFired);
|
||||
if (process.platform !== 'win32' && process.getuid() !== 0) {
|
||||
if (!common.isWindows && process.getuid() !== 0) {
|
||||
assert.ok(accessErrorFired);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue