Browse Source

test: fix var redeclarations in test-os

PR-URL: https://github.com/nodejs/node/pull/4990
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
v4.x
Rich Trott 9 years ago
committed by Myles Borins
parent
commit
54a40142cd
  1. 34
      test/parallel/test-os.js

34
test/parallel/test-os.js

@ -13,7 +13,7 @@ if (common.isWindows) {
process.env.TEMP = '';
assert.equal(os.tmpdir(), '/tmp');
process.env.TMP = '';
var expected = (process.env.SystemRoot || process.env.windir) + '\\temp';
const expected = (process.env.SystemRoot || process.env.windir) + '\\temp';
assert.equal(os.tmpdir(), expected);
process.env.TEMP = '\\temp\\';
assert.equal(os.tmpdir(), '\\temp');
@ -83,21 +83,25 @@ var interfaces = os.networkInterfaces();
console.error(interfaces);
switch (platform) {
case 'linux':
var filter = function(e) { return e.address == '127.0.0.1'; };
var actual = interfaces.lo.filter(filter);
var expected = [{ address: '127.0.0.1', netmask: '255.0.0.0',
mac: '00:00:00:00:00:00', family: 'IPv4',
internal: true }];
assert.deepEqual(actual, expected);
break;
{
const filter = function(e) { return e.address == '127.0.0.1'; };
const actual = interfaces.lo.filter(filter);
const expected = [{ address: '127.0.0.1', netmask: '255.0.0.0',
mac: '00:00:00:00:00:00', family: 'IPv4',
internal: true }];
assert.deepEqual(actual, expected);
break;
}
case 'win32':
var filter = function(e) { return e.address == '127.0.0.1'; };
var actual = interfaces['Loopback Pseudo-Interface 1'].filter(filter);
var expected = [{ address: '127.0.0.1', netmask: '255.0.0.0',
mac: '00:00:00:00:00:00', family: 'IPv4',
internal: true }];
assert.deepEqual(actual, expected);
break;
{
const filter = function(e) { return e.address == '127.0.0.1'; };
const actual = interfaces['Loopback Pseudo-Interface 1'].filter(filter);
const expected = [{ address: '127.0.0.1', netmask: '255.0.0.0',
mac: '00:00:00:00:00:00', family: 'IPv4',
internal: true }];
assert.deepEqual(actual, expected);
break;
}
}
var EOL = os.EOL;

Loading…
Cancel
Save