Skip to content

Commit

Permalink
test: fix var redeclarations in test-os
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
Trott authored and rvagg committed Feb 8, 2016
1 parent 0d4b538 commit b16b360
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions test/parallel/test-os.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b16b360

Please sign in to comment.