test: replace deprecated util.debug() calls
common.debug() is just util.debug() and emits a deprecation notice. Per docs, use console.error() instead. PR-URL: https://github.com/nodejs/node/pull/3082 Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
This commit is contained in:
parent
680dda8023
commit
44efd66132
@ -52,7 +52,7 @@ var logChild = function(d) {
|
|||||||
|
|
||||||
d.split('\n').forEach(function(l) {
|
d.split('\n').forEach(function(l) {
|
||||||
if (l.length > 0) {
|
if (l.length > 0) {
|
||||||
common.debug('CHILD: ' + l);
|
console.error('CHILD: ' + l);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -10,8 +10,8 @@ fs.readFile(filename, 'binary', function(err, content) {
|
|||||||
if (err) {
|
if (err) {
|
||||||
got_error = true;
|
got_error = true;
|
||||||
} else {
|
} else {
|
||||||
common.debug('cat returned some content: ' + content);
|
console.error('cat returned some content: ' + content);
|
||||||
common.debug('this shouldn\'t happen as the file doesn\'t exist...');
|
console.error('this shouldn\'t happen as the file doesn\'t exist...');
|
||||||
assert.equal(true, false);
|
assert.equal(true, false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -326,7 +326,6 @@ function test_deep_symlink_mix(callback) {
|
|||||||
[fixturesAbsDir + '/nested-index/two/realpath-c',
|
[fixturesAbsDir + '/nested-index/two/realpath-c',
|
||||||
'../../../' + common.tmpDirName + '/cycles/root.js']
|
'../../../' + common.tmpDirName + '/cycles/root.js']
|
||||||
].forEach(function(t) {
|
].forEach(function(t) {
|
||||||
//common.debug('setting up '+t[0]+' -> '+t[1]);
|
|
||||||
try { fs.unlinkSync(t[0]); } catch (e) {}
|
try { fs.unlinkSync(t[0]); } catch (e) {}
|
||||||
fs.symlinkSync(t[1], t[0]);
|
fs.symlinkSync(t[1], t[0]);
|
||||||
unlink.push(t[0]);
|
unlink.push(t[0]);
|
||||||
|
@ -8,7 +8,7 @@ var serverRequests = 0;
|
|||||||
var clientResponses = 0;
|
var clientResponses = 0;
|
||||||
|
|
||||||
var server = http.createServer(function(req, res) {
|
var server = http.createServer(function(req, res) {
|
||||||
common.debug('Server got GET request');
|
console.error('Server got GET request');
|
||||||
req.resume();
|
req.resume();
|
||||||
++serverRequests;
|
++serverRequests;
|
||||||
res.writeHead(200);
|
res.writeHead(200);
|
||||||
@ -18,7 +18,7 @@ var server = http.createServer(function(req, res) {
|
|||||||
}, 50);
|
}, 50);
|
||||||
});
|
});
|
||||||
server.on('connect', function(req, socket, firstBodyChunk) {
|
server.on('connect', function(req, socket, firstBodyChunk) {
|
||||||
common.debug('Server got CONNECT request');
|
console.error('Server got CONNECT request');
|
||||||
serverConnected = true;
|
serverConnected = true;
|
||||||
socket.write('HTTP/1.1 200 Connection established\r\n\r\n');
|
socket.write('HTTP/1.1 200 Connection established\r\n\r\n');
|
||||||
socket.resume();
|
socket.resume();
|
||||||
@ -33,7 +33,7 @@ server.listen(common.PORT, function() {
|
|||||||
path: 'google.com:80'
|
path: 'google.com:80'
|
||||||
});
|
});
|
||||||
req.on('connect', function(res, socket, firstBodyChunk) {
|
req.on('connect', function(res, socket, firstBodyChunk) {
|
||||||
common.debug('Client got CONNECT response');
|
console.error('Client got CONNECT response');
|
||||||
socket.end();
|
socket.end();
|
||||||
socket.on('end', function() {
|
socket.on('end', function() {
|
||||||
doRequest(0);
|
doRequest(0);
|
||||||
@ -49,7 +49,7 @@ function doRequest(i) {
|
|||||||
port: common.PORT,
|
port: common.PORT,
|
||||||
path: '/request' + i
|
path: '/request' + i
|
||||||
}, function(res) {
|
}, function(res) {
|
||||||
common.debug('Client got GET response');
|
console.error('Client got GET response');
|
||||||
var data = '';
|
var data = '';
|
||||||
res.setEncoding('utf8');
|
res.setEncoding('utf8');
|
||||||
res.on('data', function(chunk) {
|
res.on('data', function(chunk) {
|
||||||
|
@ -12,7 +12,7 @@ var server = http.createServer(function(req, res) {
|
|||||||
server.on('connect', function(req, socket, firstBodyChunk) {
|
server.on('connect', function(req, socket, firstBodyChunk) {
|
||||||
assert.equal(req.method, 'CONNECT');
|
assert.equal(req.method, 'CONNECT');
|
||||||
assert.equal(req.url, 'google.com:443');
|
assert.equal(req.url, 'google.com:443');
|
||||||
common.debug('Server got CONNECT request');
|
console.error('Server got CONNECT request');
|
||||||
serverGotConnect = true;
|
serverGotConnect = true;
|
||||||
|
|
||||||
socket.write('HTTP/1.1 200 Connection established\r\n\r\n');
|
socket.write('HTTP/1.1 200 Connection established\r\n\r\n');
|
||||||
@ -40,7 +40,7 @@ server.listen(common.PORT, function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
req.on('connect', function(res, socket, firstBodyChunk) {
|
req.on('connect', function(res, socket, firstBodyChunk) {
|
||||||
common.debug('Client got CONNECT request');
|
console.error('Client got CONNECT request');
|
||||||
clientGotConnect = true;
|
clientGotConnect = true;
|
||||||
|
|
||||||
// Make sure this request got removed from the pool.
|
// Make sure this request got removed from the pool.
|
||||||
|
@ -11,7 +11,7 @@ var got_continue = false;
|
|||||||
|
|
||||||
function handler(req, res) {
|
function handler(req, res) {
|
||||||
assert.equal(sent_continue, true, 'Full response sent before 100 Continue');
|
assert.equal(sent_continue, true, 'Full response sent before 100 Continue');
|
||||||
common.debug('Server sending full response...');
|
console.error('Server sending full response...');
|
||||||
res.writeHead(200, {
|
res.writeHead(200, {
|
||||||
'Content-Type' : 'text/plain',
|
'Content-Type' : 'text/plain',
|
||||||
'ABCD' : '1'
|
'ABCD' : '1'
|
||||||
@ -21,7 +21,7 @@ function handler(req, res) {
|
|||||||
|
|
||||||
var server = http.createServer(handler);
|
var server = http.createServer(handler);
|
||||||
server.on('checkContinue', function(req, res) {
|
server.on('checkContinue', function(req, res) {
|
||||||
common.debug('Server got Expect: 100-continue...');
|
console.error('Server got Expect: 100-continue...');
|
||||||
res.writeContinue();
|
res.writeContinue();
|
||||||
sent_continue = true;
|
sent_continue = true;
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
@ -38,11 +38,11 @@ server.on('listening', function() {
|
|||||||
path: '/world',
|
path: '/world',
|
||||||
headers: { 'Expect': '100-continue' }
|
headers: { 'Expect': '100-continue' }
|
||||||
});
|
});
|
||||||
common.debug('Client sending request...');
|
console.error('Client sending request...');
|
||||||
outstanding_reqs++;
|
outstanding_reqs++;
|
||||||
var body = '';
|
var body = '';
|
||||||
req.on('continue', function() {
|
req.on('continue', function() {
|
||||||
common.debug('Client got 100 Continue...');
|
console.error('Client got 100 Continue...');
|
||||||
got_continue = true;
|
got_continue = true;
|
||||||
req.end(test_req_body);
|
req.end(test_req_body);
|
||||||
});
|
});
|
||||||
@ -54,7 +54,7 @@ server.on('listening', function() {
|
|||||||
res.setEncoding('utf8');
|
res.setEncoding('utf8');
|
||||||
res.on('data', function(chunk) { body += chunk; });
|
res.on('data', function(chunk) { body += chunk; });
|
||||||
res.on('end', function() {
|
res.on('end', function() {
|
||||||
common.debug('Got full response.');
|
console.error('Got full response.');
|
||||||
assert.equal(body, test_res_body, 'Response body doesn\'t match.');
|
assert.equal(body, test_res_body, 'Response body doesn\'t match.');
|
||||||
assert.ok('abcd' in res.headers, 'Response headers missing.');
|
assert.ok('abcd' in res.headers, 'Response headers missing.');
|
||||||
outstanding_reqs--;
|
outstanding_reqs--;
|
||||||
|
@ -54,7 +54,7 @@ server.listen(common.PORT, function() {
|
|||||||
responses_recvd += 1;
|
responses_recvd += 1;
|
||||||
res.setEncoding('utf8');
|
res.setEncoding('utf8');
|
||||||
res.on('data', function(chunk) { body0 += chunk; });
|
res.on('data', function(chunk) { body0 += chunk; });
|
||||||
common.debug('Got /hello response');
|
console.error('Got /hello response');
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
@ -65,16 +65,16 @@ server.listen(common.PORT, function() {
|
|||||||
responses_recvd += 1;
|
responses_recvd += 1;
|
||||||
res.setEncoding('utf8');
|
res.setEncoding('utf8');
|
||||||
res.on('data', function(chunk) { body1 += chunk; });
|
res.on('data', function(chunk) { body1 += chunk; });
|
||||||
common.debug('Got /world response');
|
console.error('Got /world response');
|
||||||
});
|
});
|
||||||
}, 1);
|
}, 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
process.on('exit', function() {
|
process.on('exit', function() {
|
||||||
common.debug('responses_recvd: ' + responses_recvd);
|
console.error('responses_recvd: ' + responses_recvd);
|
||||||
assert.equal(2, responses_recvd);
|
assert.equal(2, responses_recvd);
|
||||||
|
|
||||||
common.debug('responses_sent: ' + responses_sent);
|
console.error('responses_sent: ' + responses_sent);
|
||||||
assert.equal(2, responses_sent);
|
assert.equal(2, responses_sent);
|
||||||
|
|
||||||
assert.equal('The path was /hello', body0);
|
assert.equal('The path was /hello', body0);
|
||||||
|
@ -9,17 +9,17 @@ var expectedClient = 'Response Body from Server';
|
|||||||
var resultClient = '';
|
var resultClient = '';
|
||||||
|
|
||||||
var server = http.createServer(function(req, res) {
|
var server = http.createServer(function(req, res) {
|
||||||
common.debug('pause server request');
|
console.error('pause server request');
|
||||||
req.pause();
|
req.pause();
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
common.debug('resume server request');
|
console.error('resume server request');
|
||||||
req.resume();
|
req.resume();
|
||||||
req.setEncoding('utf8');
|
req.setEncoding('utf8');
|
||||||
req.on('data', function(chunk) {
|
req.on('data', function(chunk) {
|
||||||
resultServer += chunk;
|
resultServer += chunk;
|
||||||
});
|
});
|
||||||
req.on('end', function() {
|
req.on('end', function() {
|
||||||
common.debug(resultServer);
|
console.error(resultServer);
|
||||||
res.writeHead(200);
|
res.writeHead(200);
|
||||||
res.end(expectedClient);
|
res.end(expectedClient);
|
||||||
});
|
});
|
||||||
@ -32,16 +32,16 @@ server.listen(common.PORT, function() {
|
|||||||
path: '/',
|
path: '/',
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
}, function(res) {
|
}, function(res) {
|
||||||
common.debug('pause client response');
|
console.error('pause client response');
|
||||||
res.pause();
|
res.pause();
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
common.debug('resume client response');
|
console.error('resume client response');
|
||||||
res.resume();
|
res.resume();
|
||||||
res.on('data', function(chunk) {
|
res.on('data', function(chunk) {
|
||||||
resultClient += chunk;
|
resultClient += chunk;
|
||||||
});
|
});
|
||||||
res.on('end', function() {
|
res.on('end', function() {
|
||||||
common.debug(resultClient);
|
console.error(resultClient);
|
||||||
server.close();
|
server.close();
|
||||||
});
|
});
|
||||||
}, 100);
|
}, 100);
|
||||||
|
@ -31,7 +31,7 @@ var server = http.createServer(function(req, res) {
|
|||||||
}
|
}
|
||||||
}, function(res) {
|
}, function(res) {
|
||||||
res.on('end', function() {
|
res.on('end', function() {
|
||||||
common.debug('res' + i + ' end');
|
console.error('res' + i + ' end');
|
||||||
if (i === 2) {
|
if (i === 2) {
|
||||||
server.close();
|
server.close();
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ var server = http.createServer(function(req, res) {
|
|||||||
res.resume();
|
res.resume();
|
||||||
});
|
});
|
||||||
req.on('socket', function(s) {
|
req.on('socket', function(s) {
|
||||||
common.debug('req' + i + ' start');
|
console.error('req' + i + ' start');
|
||||||
});
|
});
|
||||||
req.end('12345');
|
req.end('12345');
|
||||||
}(i + 1));
|
}(i + 1));
|
||||||
|
@ -10,7 +10,7 @@ var server = http.createServer(function(req, res) {
|
|||||||
assert.ok(s instanceof net.Socket);
|
assert.ok(s instanceof net.Socket);
|
||||||
req.connection.on('timeout', function() {
|
req.connection.on('timeout', function() {
|
||||||
req.connection.destroy();
|
req.connection.destroy();
|
||||||
common.debug('TIMEOUT');
|
console.error('TIMEOUT');
|
||||||
server.close();
|
server.close();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -56,7 +56,7 @@ server.on('listening', function() {
|
|||||||
responses_recvd += 1;
|
responses_recvd += 1;
|
||||||
res.setEncoding('utf8');
|
res.setEncoding('utf8');
|
||||||
res.on('data', function(chunk) { body0 += chunk; });
|
res.on('data', function(chunk) { body0 += chunk; });
|
||||||
common.debug('Got /hello response');
|
console.error('Got /hello response');
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
@ -70,17 +70,17 @@ server.on('listening', function() {
|
|||||||
responses_recvd += 1;
|
responses_recvd += 1;
|
||||||
res.setEncoding('utf8');
|
res.setEncoding('utf8');
|
||||||
res.on('data', function(chunk) { body1 += chunk; });
|
res.on('data', function(chunk) { body1 += chunk; });
|
||||||
common.debug('Got /world response');
|
console.error('Got /world response');
|
||||||
});
|
});
|
||||||
req.end();
|
req.end();
|
||||||
}, 1);
|
}, 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
process.on('exit', function() {
|
process.on('exit', function() {
|
||||||
common.debug('responses_recvd: ' + responses_recvd);
|
console.error('responses_recvd: ' + responses_recvd);
|
||||||
assert.equal(2, responses_recvd);
|
assert.equal(2, responses_recvd);
|
||||||
|
|
||||||
common.debug('responses_sent: ' + responses_sent);
|
console.error('responses_sent: ' + responses_sent);
|
||||||
assert.equal(2, responses_sent);
|
assert.equal(2, responses_sent);
|
||||||
|
|
||||||
assert.equal('The path was /hello', body0);
|
assert.equal('The path was /hello', body0);
|
||||||
|
@ -34,7 +34,7 @@ server.listen(common.PORT, function() {
|
|||||||
}, function(res) {
|
}, function(res) {
|
||||||
var timer;
|
var timer;
|
||||||
res.pause();
|
res.pause();
|
||||||
common.debug('paused');
|
console.error('paused');
|
||||||
send();
|
send();
|
||||||
function send() {
|
function send() {
|
||||||
if (req.write(new Buffer(bufSize))) {
|
if (req.write(new Buffer(bufSize))) {
|
||||||
@ -43,10 +43,10 @@ server.listen(common.PORT, function() {
|
|||||||
return process.nextTick(send);
|
return process.nextTick(send);
|
||||||
}
|
}
|
||||||
sent += bufSize;
|
sent += bufSize;
|
||||||
common.debug('sent: ' + sent);
|
console.error('sent: ' + sent);
|
||||||
resumed = true;
|
resumed = true;
|
||||||
res.resume();
|
res.resume();
|
||||||
common.debug('resumed');
|
console.error('resumed');
|
||||||
timer = setTimeout(function() {
|
timer = setTimeout(function() {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
@ -60,7 +60,7 @@ server.listen(common.PORT, function() {
|
|||||||
}
|
}
|
||||||
received += data.length;
|
received += data.length;
|
||||||
if (received >= sent) {
|
if (received >= sent) {
|
||||||
common.debug('received: ' + received);
|
console.error('received: ' + received);
|
||||||
req.end();
|
req.end();
|
||||||
server.close();
|
server.close();
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
|
|
||||||
common.debug('load test-module-loading-error.js');
|
console.error('load test-module-loading-error.js');
|
||||||
|
|
||||||
var error_desc = {
|
var error_desc = {
|
||||||
win32: '%1 is not a valid Win32 application',
|
win32: '%1 is not a valid Win32 application',
|
||||||
|
@ -10,7 +10,7 @@ server.listen(common.PORT, function() {
|
|||||||
assert(false);
|
assert(false);
|
||||||
});
|
});
|
||||||
server.on('error', function(error) {
|
server.on('error', function(error) {
|
||||||
common.debug(error);
|
console.error(error);
|
||||||
assert(false);
|
assert(false);
|
||||||
});
|
});
|
||||||
server.close();
|
server.close();
|
||||||
|
@ -10,7 +10,7 @@ server.listen(1, '1.1.1.1', function() { // EACCESS or EADDRNOTAVAIL
|
|||||||
assert(false);
|
assert(false);
|
||||||
});
|
});
|
||||||
server.on('error', function(error) {
|
server.on('error', function(error) {
|
||||||
common.debug(error);
|
console.error(error);
|
||||||
gotError = true;
|
gotError = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ var connectCount = 0;
|
|||||||
var server = tls.createServer(options, function(socket) {
|
var server = tls.createServer(options, function(socket) {
|
||||||
++connectCount;
|
++connectCount;
|
||||||
socket.on('data', function(data) {
|
socket.on('data', function(data) {
|
||||||
common.debug(data.toString());
|
console.error(data.toString());
|
||||||
assert.equal(data, 'ok');
|
assert.equal(data, 'ok');
|
||||||
});
|
});
|
||||||
}).listen(common.PORT, function() {
|
}).listen(common.PORT, function() {
|
||||||
@ -51,7 +51,7 @@ function rejectUnauthorized() {
|
|||||||
assert(false);
|
assert(false);
|
||||||
});
|
});
|
||||||
socket.on('error', function(err) {
|
socket.on('error', function(err) {
|
||||||
common.debug(err);
|
console.error(err);
|
||||||
authorized();
|
authorized();
|
||||||
});
|
});
|
||||||
socket.write('ng');
|
socket.write('ng');
|
||||||
|
@ -35,7 +35,7 @@ server.listen(common.PORT, function() {
|
|||||||
}, function() {
|
}, function() {
|
||||||
console.error('connected');
|
console.error('connected');
|
||||||
client.pause();
|
client.pause();
|
||||||
common.debug('paused');
|
console.error('paused');
|
||||||
send();
|
send();
|
||||||
function send() {
|
function send() {
|
||||||
console.error('sending');
|
console.error('sending');
|
||||||
@ -48,7 +48,7 @@ server.listen(common.PORT, function() {
|
|||||||
return process.nextTick(send);
|
return process.nextTick(send);
|
||||||
}
|
}
|
||||||
sent += bufSize;
|
sent += bufSize;
|
||||||
common.debug('sent: ' + sent);
|
console.error('sent: ' + sent);
|
||||||
resumed = true;
|
resumed = true;
|
||||||
client.resume();
|
client.resume();
|
||||||
console.error('resumed', client);
|
console.error('resumed', client);
|
||||||
@ -61,7 +61,7 @@ server.listen(common.PORT, function() {
|
|||||||
console.error('received', received);
|
console.error('received', received);
|
||||||
console.error('sent', sent);
|
console.error('sent', sent);
|
||||||
if (received >= sent) {
|
if (received >= sent) {
|
||||||
common.debug('received: ' + received);
|
console.error('received: ' + received);
|
||||||
client.end();
|
client.end();
|
||||||
server.close();
|
server.close();
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ server.listen(common.PORT, function() {
|
|||||||
}, function() {
|
}, function() {
|
||||||
var peerCert = socket.getPeerCertificate();
|
var peerCert = socket.getPeerCertificate();
|
||||||
|
|
||||||
common.debug(util.inspect(peerCert));
|
console.error(util.inspect(peerCert));
|
||||||
assert.equal(peerCert.subject.CN, 'Ádám Lippai');
|
assert.equal(peerCert.subject.CN, 'Ádám Lippai');
|
||||||
verified = true;
|
verified = true;
|
||||||
server.close();
|
server.close();
|
||||||
|
@ -28,7 +28,7 @@ server.listen(common.PORT, function() {
|
|||||||
rejectUnauthorized: false
|
rejectUnauthorized: false
|
||||||
}, function() {
|
}, function() {
|
||||||
var peerCert = socket.getPeerCertificate();
|
var peerCert = socket.getPeerCertificate();
|
||||||
common.debug(util.inspect(peerCert));
|
console.error(util.inspect(peerCert));
|
||||||
assert.deepEqual(peerCert.subject.OU,
|
assert.deepEqual(peerCert.subject.OU,
|
||||||
['Information Technology', 'Engineering', 'Marketing']);
|
['Information Technology', 'Engineering', 'Marketing']);
|
||||||
verified = true;
|
verified = true;
|
||||||
|
@ -35,7 +35,7 @@ server.listen(common.PORT, function() {
|
|||||||
peerCert = socket.getPeerCertificate(true);
|
peerCert = socket.getPeerCertificate(true);
|
||||||
assert.ok(peerCert.issuerCertificate);
|
assert.ok(peerCert.issuerCertificate);
|
||||||
|
|
||||||
common.debug(util.inspect(peerCert));
|
console.error(util.inspect(peerCert));
|
||||||
assert.equal(peerCert.subject.emailAddress, 'ry@tinyclouds.org');
|
assert.equal(peerCert.subject.emailAddress, 'ry@tinyclouds.org');
|
||||||
assert.equal(peerCert.serialNumber, '9A84ABCFB8A72AC0');
|
assert.equal(peerCert.serialNumber, '9A84ABCFB8A72AC0');
|
||||||
assert.equal(peerCert.exponent, '0x10001');
|
assert.equal(peerCert.exponent, '0x10001');
|
||||||
|
@ -65,5 +65,5 @@ server.listen(common.PORT);
|
|||||||
|
|
||||||
process.on('exit', function() {
|
process.on('exit', function() {
|
||||||
assert.equal(N, recv.length);
|
assert.equal(N, recv.length);
|
||||||
common.debug('Exit');
|
console.error('Exit');
|
||||||
});
|
});
|
||||||
|
@ -27,7 +27,7 @@ function pingPongTest(port, host, on_complete) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.on('timeout', function() {
|
socket.on('timeout', function() {
|
||||||
common.debug('server-side timeout!!');
|
console.error('server-side timeout!!');
|
||||||
assert.equal(false, true);
|
assert.equal(false, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ function pingPongTest(port, host, on_complete) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
client.on('timeout', function() {
|
client.on('timeout', function() {
|
||||||
common.debug('client-side timeout!!');
|
console.error('client-side timeout!!');
|
||||||
assert.equal(false, true);
|
assert.equal(false, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ var assert = require('assert');
|
|||||||
var path = require('path');
|
var path = require('path');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
common.debug('load test-module-loading.js');
|
console.error('load test-module-loading.js');
|
||||||
|
|
||||||
// assert that this is the main module.
|
// assert that this is the main module.
|
||||||
assert.equal(require.main.id, '.', 'main module should have id of \'.\'');
|
assert.equal(require.main.id, '.', 'main module should have id of \'.\'');
|
||||||
@ -56,36 +56,36 @@ assert.equal('D', d4.D());
|
|||||||
|
|
||||||
assert.ok((new a.SomeClass()) instanceof c.SomeClass);
|
assert.ok((new a.SomeClass()) instanceof c.SomeClass);
|
||||||
|
|
||||||
common.debug('test index.js modules ids and relative loading');
|
console.error('test index.js modules ids and relative loading');
|
||||||
var one = require('../fixtures/nested-index/one'),
|
var one = require('../fixtures/nested-index/one'),
|
||||||
two = require('../fixtures/nested-index/two');
|
two = require('../fixtures/nested-index/two');
|
||||||
assert.notEqual(one.hello, two.hello);
|
assert.notEqual(one.hello, two.hello);
|
||||||
|
|
||||||
common.debug('test index.js in a folder with a trailing slash');
|
console.error('test index.js in a folder with a trailing slash');
|
||||||
var three = require('../fixtures/nested-index/three'),
|
var three = require('../fixtures/nested-index/three'),
|
||||||
threeFolder = require('../fixtures/nested-index/three/'),
|
threeFolder = require('../fixtures/nested-index/three/'),
|
||||||
threeIndex = require('../fixtures/nested-index/three/index.js');
|
threeIndex = require('../fixtures/nested-index/three/index.js');
|
||||||
assert.equal(threeFolder, threeIndex);
|
assert.equal(threeFolder, threeIndex);
|
||||||
assert.notEqual(threeFolder, three);
|
assert.notEqual(threeFolder, three);
|
||||||
|
|
||||||
common.debug('test package.json require() loading');
|
console.error('test package.json require() loading');
|
||||||
assert.equal(require('../fixtures/packages/main').ok, 'ok',
|
assert.equal(require('../fixtures/packages/main').ok, 'ok',
|
||||||
'Failed loading package');
|
'Failed loading package');
|
||||||
assert.equal(require('../fixtures/packages/main-index').ok, 'ok',
|
assert.equal(require('../fixtures/packages/main-index').ok, 'ok',
|
||||||
'Failed loading package with index.js in main subdir');
|
'Failed loading package with index.js in main subdir');
|
||||||
|
|
||||||
common.debug('test cycles containing a .. path');
|
console.error('test cycles containing a .. path');
|
||||||
var root = require('../fixtures/cycles/root'),
|
var root = require('../fixtures/cycles/root'),
|
||||||
foo = require('../fixtures/cycles/folder/foo');
|
foo = require('../fixtures/cycles/folder/foo');
|
||||||
assert.equal(root.foo, foo);
|
assert.equal(root.foo, foo);
|
||||||
assert.equal(root.sayHello(), root.hello);
|
assert.equal(root.sayHello(), root.hello);
|
||||||
|
|
||||||
common.debug('test node_modules folders');
|
console.error('test node_modules folders');
|
||||||
// asserts are in the fixtures files themselves,
|
// asserts are in the fixtures files themselves,
|
||||||
// since they depend on the folder structure.
|
// since they depend on the folder structure.
|
||||||
require('../fixtures/node_modules/foo');
|
require('../fixtures/node_modules/foo');
|
||||||
|
|
||||||
common.debug('test name clashes');
|
console.error('test name clashes');
|
||||||
// this one exists and should import the local module
|
// this one exists and should import the local module
|
||||||
var my_path = require('../fixtures/path');
|
var my_path = require('../fixtures/path');
|
||||||
assert.ok(common.indirectInstanceOf(my_path.path_func, Function));
|
assert.ok(common.indirectInstanceOf(my_path.path_func, Function));
|
||||||
@ -102,7 +102,7 @@ try {
|
|||||||
|
|
||||||
assert.equal(require('path').dirname(__filename), __dirname);
|
assert.equal(require('path').dirname(__filename), __dirname);
|
||||||
|
|
||||||
common.debug('load custom file types with extensions');
|
console.error('load custom file types with extensions');
|
||||||
require.extensions['.test'] = function(module, filename) {
|
require.extensions['.test'] = function(module, filename) {
|
||||||
var content = fs.readFileSync(filename).toString();
|
var content = fs.readFileSync(filename).toString();
|
||||||
assert.equal('this is custom source\n', content);
|
assert.equal('this is custom source\n', content);
|
||||||
@ -115,7 +115,7 @@ assert.equal(require('../fixtures/registerExt').test, 'passed');
|
|||||||
// unknown extension, load as .js
|
// unknown extension, load as .js
|
||||||
assert.equal(require('../fixtures/registerExt.hello.world').test, 'passed');
|
assert.equal(require('../fixtures/registerExt.hello.world').test, 'passed');
|
||||||
|
|
||||||
common.debug('load custom file types that return non-strings');
|
console.error('load custom file types that return non-strings');
|
||||||
require.extensions['.test'] = function(module, filename) {
|
require.extensions['.test'] = function(module, filename) {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
custom: 'passed'
|
custom: 'passed'
|
||||||
@ -139,7 +139,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check load order is as expected
|
// Check load order is as expected
|
||||||
common.debug('load order');
|
console.error('load order');
|
||||||
|
|
||||||
var loadOrder = '../fixtures/module-load-order/',
|
var loadOrder = '../fixtures/module-load-order/',
|
||||||
msg = 'Load order incorrect.';
|
msg = 'Load order incorrect.';
|
||||||
|
@ -17,8 +17,8 @@ var server = net.createServer(function(stream) {
|
|||||||
if (err) {
|
if (err) {
|
||||||
got_error = true;
|
got_error = true;
|
||||||
} else {
|
} else {
|
||||||
common.debug('util.pump\'s callback fired with no error');
|
console.error('util.pump\'s callback fired with no error');
|
||||||
common.debug('this shouldn\'t happen as the file doesn\'t exist...');
|
console.error('this shouldn\'t happen as the file doesn\'t exist...');
|
||||||
assert.equal(true, false);
|
assert.equal(true, false);
|
||||||
}
|
}
|
||||||
server.close();
|
server.close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user