~yolanda.robla/ubuntu/trusty/nodejs/add_distribution

« back to all changes in this revision

Viewing changes to test/simple/test-os.js

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2013-08-14 00:16:46 UTC
  • mfrom: (7.1.40 sid)
  • Revision ID: package-import@ubuntu.com-20130814001646-bzlysfh8sd6mukbo
Tags: 0.10.15~dfsg1-4
* Update 2005 patch, adding a handful of tests that can fail on
  slow platforms.
* Add 1004 patch to fix test failures when writing NaN to buffer
  on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
var os = require('os');
28
28
 
29
29
 
 
30
process.env.TMPDIR = '/tmpdir';
 
31
process.env.TMP = '/tmp';
 
32
process.env.TEMP = '/temp';
 
33
var t = ( process.platform === 'win32' ? 'c:\\windows\\temp' : '/tmp' );
 
34
assert.equal(os.tmpdir(), '/tmpdir');
 
35
process.env.TMPDIR = '';
 
36
assert.equal(os.tmpdir(), '/tmp');
 
37
process.env.TMP = '';
 
38
assert.equal(os.tmpdir(), '/temp');
 
39
process.env.TEMP = '';
 
40
assert.equal(os.tmpdir(), t);
 
41
 
 
42
var endianness = os.endianness();
 
43
console.log('endianness = %s', endianness);
 
44
assert.ok(/[BL]E/.test(endianness));
 
45
 
30
46
var hostname = os.hostname();
31
47
console.log('hostname = %s', hostname);
32
48
assert.ok(hostname.length > 0);
72
88
    var expected = [{ address: '127.0.0.1', family: 'IPv4', internal: true }];
73
89
    assert.deepEqual(actual, expected);
74
90
    break;
 
91
  case 'win32':
 
92
    var filter = function(e) { return e.address == '127.0.0.1'; };
 
93
    var actual = interfaces['Loopback Pseudo-Interface 1'].filter(filter);
 
94
    var expected = [{ address: '127.0.0.1', family: 'IPv4', internal: true }];
 
95
    assert.deepEqual(actual, expected);
 
96
    break;
75
97
}
 
98
 
 
99
var EOL = os.EOL;
 
100
assert.ok(EOL.length > 0);