Browse Source

test,tools: adjust function argument alignment

In preparation for a lint rule enforcing function argument alignment,
adjust function arguments to be aligned.

PR-URL: https://github.com/nodejs/node/pull/7100
Refs: https://github.com/nodejs/node/pull/6390
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Imran Iqbal <imran@imraniqbal.org>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ryan Graham <r.m.graham@gmail.com>
v4.x
Rich Trott 9 years ago
committed by Myles Borins
parent
commit
7e739ae159
  1. 2
      test/internet/test-dgram-multicast-multi-process.js
  2. 2
      test/parallel/test-assert.js
  3. 36
      test/parallel/test-buffer.js
  4. 4
      test/parallel/test-cluster-basic.js
  5. 7
      test/parallel/test-crypto-binary-default.js
  6. 7
      test/parallel/test-crypto-hash.js
  7. 2
      test/parallel/test-domain-exit-dispose-again.js
  8. 8
      test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js
  9. 4
      test/parallel/test-domain-timers.js
  10. 2
      test/parallel/test-domain-top-level-error-handler-clears-stack.js
  11. 4
      test/parallel/test-file-write-stream2.js
  12. 4
      test/parallel/test-file-write-stream3.js
  13. 8
      test/parallel/test-fs-realpath.js
  14. 2
      test/parallel/test-http-agent-error-on-idle.js
  15. 2
      test/parallel/test-http-agent-keepalive.js
  16. 2
      test/parallel/test-http-agent-maxsockets.js
  17. 4
      test/parallel/test-http-destroyed-socket-write2.js
  18. 2
      test/parallel/test-http-parser-bad-ref.js
  19. 2
      test/parallel/test-http-url.parse-post.js
  20. 2
      test/parallel/test-require-process.js
  21. 2
      test/parallel/test-timers-ordering.js
  22. 4
      test/parallel/test-timers-reset-process-domain-on-throw.js
  23. 16
      test/parallel/test-zlib-convenience-methods.js
  24. 8
      test/parallel/test-zlib-flush-drain.js
  25. 10
      tools/doc/html.js

2
test/internet/test-dgram-multicast-multi-process.js

@ -91,7 +91,7 @@ function launchChildProcess(index) {
worker.pid, count); worker.pid, count);
assert.strictEqual(count, messages.length, assert.strictEqual(count, messages.length,
'A worker received an invalid multicast message'); 'A worker received an invalid multicast message');
}); });
clearTimeout(timer); clearTimeout(timer);

2
test/parallel/test-assert.js

@ -461,7 +461,7 @@ try {
} catch (e) { } catch (e) {
assert.equal(e.toString().split('\n')[0], 'AssertionError: oh no'); assert.equal(e.toString().split('\n')[0], 'AssertionError: oh no');
assert.equal(e.generatedMessage, false, assert.equal(e.generatedMessage, false,
'Message incorrectly marked as generated'); 'Message incorrectly marked as generated');
} }
// Verify that throws() and doesNotThrow() throw on non-function block // Verify that throws() and doesNotThrow() throw on non-function block

36
test/parallel/test-buffer.js

@ -571,18 +571,30 @@ assert.equal(new Buffer('KioqKioqKioqKioqKioqKioqKio', 'base64').toString(),
'********************'); '********************');
// handle padding graciously, multiple-of-4 or not // handle padding graciously, multiple-of-4 or not
assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==', assert.equal(
'base64').length, 32); new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==', 'base64').length,
assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=', 32
'base64').length, 32); );
assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw', assert.equal(
'base64').length, 32); new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=', 'base64').length,
assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==', 32
'base64').length, 31); );
assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=', assert.equal(
'base64').length, 31); new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw', 'base64').length,
assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg', 32
'base64').length, 31); );
assert.equal(
new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==', 'base64').length,
31
);
assert.equal(
new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=', 'base64').length,
31
);
assert.equal(
new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg', 'base64').length,
31
);
// This string encodes single '.' character in UTF-16 // This string encodes single '.' character in UTF-16
var dot = new Buffer('//4uAA==', 'base64'); var dot = new Buffer('//4uAA==', 'base64');

4
test/parallel/test-cluster-basic.js

@ -4,7 +4,7 @@ var assert = require('assert');
var cluster = require('cluster'); var cluster = require('cluster');
assert.equal('NODE_UNIQUE_ID' in process.env, false, assert.equal('NODE_UNIQUE_ID' in process.env, false,
'NODE_UNIQUE_ID should be removed on startup'); 'NODE_UNIQUE_ID should be removed on startup');
function forEach(obj, fn) { function forEach(obj, fn) {
Object.keys(obj).forEach(function(name, index) { Object.keys(obj).forEach(function(name, index) {
@ -93,7 +93,7 @@ else if (cluster.isMaster) {
worker = cluster.fork(); worker = cluster.fork();
assert.equal(worker.id, 1); assert.equal(worker.id, 1);
assert.ok(worker instanceof cluster.Worker, assert.ok(worker instanceof cluster.Worker,
'the worker is not a instance of the Worker constructor'); 'the worker is not a instance of the Worker constructor');
//Check event //Check event
forEach(checks.worker.events, function(bool, name, index) { forEach(checks.worker.events, function(bool, name, index) {

7
test/parallel/test-crypto-binary-default.js

@ -347,8 +347,11 @@ var a4 = crypto.createHash('sha1').update('Test123').digest('buffer');
if (!common.hasFipsCrypto) { if (!common.hasFipsCrypto) {
var a0 = crypto.createHash('md5').update('Test123').digest('binary'); var a0 = crypto.createHash('md5').update('Test123').digest('binary');
assert.equal(a0, 'h\u00ea\u00cb\u0097\u00d8o\fF!\u00fa+\u000e\u0017\u00ca' + assert.equal(
'\u00bd\u008c', 'Test MD5 as binary'); a0,
'h\u00ea\u00cb\u0097\u00d8o\fF!\u00fa+\u000e\u0017\u00ca\u00bd\u008c',
'Test MD5 as binary'
);
} }
assert.equal(a1, '8308651804facb7b9af8ffc53a33a22d6a1c8ac2', 'Test SHA1'); assert.equal(a1, '8308651804facb7b9af8ffc53a33a22d6a1c8ac2', 'Test SHA1');

7
test/parallel/test-crypto-hash.js

@ -39,8 +39,11 @@ a8 = a8.read();
if (!common.hasFipsCrypto) { if (!common.hasFipsCrypto) {
var a0 = crypto.createHash('md5').update('Test123').digest('binary'); var a0 = crypto.createHash('md5').update('Test123').digest('binary');
assert.equal(a0, 'h\u00ea\u00cb\u0097\u00d8o\fF!\u00fa+\u000e\u0017\u00ca' + assert.equal(
'\u00bd\u008c', 'Test MD5 as binary'); a0,
'h\u00ea\u00cb\u0097\u00d8o\fF!\u00fa+\u000e\u0017\u00ca\u00bd\u008c',
'Test MD5 as binary'
);
} }
assert.equal(a1, '8308651804facb7b9af8ffc53a33a22d6a1c8ac2', 'Test SHA1'); assert.equal(a1, '8308651804facb7b9af8ffc53a33a22d6a1c8ac2', 'Test SHA1');
assert.equal(a2, '2bX1jws4GYKTlxhloUB09Z66PoJZW+y+hq5R8dnx9l4=', assert.equal(a2, '2bX1jws4GYKTlxhloUB09Z66PoJZW+y+hq5R8dnx9l4=',

2
test/parallel/test-domain-exit-dispose-again.js

@ -38,7 +38,7 @@ setTimeout(function firstTimer() {
d.dispose(); d.dispose();
console.error(err); console.error(err);
console.error('in domain error handler', console.error('in domain error handler',
process.domain, process.domain === d); process.domain, process.domain === d);
}); });
d.run(function() { d.run(function() {

8
test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js

@ -62,8 +62,8 @@ function runTestWithoutAbortOnUncaughtException() {
'include domain\'s error\'s message'); 'include domain\'s error\'s message');
assert.notEqual(err.code, 0, assert.notEqual(err.code, 0,
'child process should have exited with a non-zero exit code, ' + 'child process should have exited with a non-zero ' +
'but did not'); 'exit code, but did not');
}); });
} }
@ -72,8 +72,8 @@ function runTestWithAbortOnUncaughtException() {
withAbortOnUncaughtException: true withAbortOnUncaughtException: true
}), function onTestDone(err, stdout, stderr) { }), function onTestDone(err, stdout, stderr) {
assert.notEqual(err.code, RAN_UNCAUGHT_EXCEPTION_HANDLER_EXIT_CODE, assert.notEqual(err.code, RAN_UNCAUGHT_EXCEPTION_HANDLER_EXIT_CODE,
'child process should not have run its uncaughtException event ' + 'child process should not have run its uncaughtException ' +
'handler'); 'event handler');
assert(common.nodeProcessAborted(err.code, err.signal), assert(common.nodeProcessAborted(err.code, err.signal),
'process should have aborted, but did not'); 'process should have aborted, but did not');
}); });

4
test/parallel/test-domain-timers.js

@ -34,7 +34,7 @@ timeout = setTimeout(function() {}, 10 * 1000);
process.on('exit', function() { process.on('exit', function() {
assert.equal(timeout_err.message, 'Timeout UNREFd', assert.equal(timeout_err.message, 'Timeout UNREFd',
'Domain should catch timer error'); 'Domain should catch timer error');
assert.equal(immediate_err.message, 'Immediate Error', assert.equal(immediate_err.message, 'Immediate Error',
'Domain should catch immediate error'); 'Domain should catch immediate error');
}); });

2
test/parallel/test-domain-top-level-error-handler-clears-stack.js

@ -23,7 +23,7 @@ d.on('error', common.mustCall(function() {
// call to process._fatalException, and so on recursively and // call to process._fatalException, and so on recursively and
// indefinitely. // indefinitely.
console.error('domains stack length should be 1, but instead is:', console.error('domains stack length should be 1, but instead is:',
domain._stack.length); domain._stack.length);
process.exit(1); process.exit(1);
} }
}); });

4
test/parallel/test-file-write-stream2.js

@ -24,8 +24,8 @@ process.on('exit', function() {
console.log(' expected: %j', cb_expected); console.log(' expected: %j', cb_expected);
console.log(' occurred: %j', cb_occurred); console.log(' occurred: %j', cb_occurred);
assert.strictEqual(cb_occurred, cb_expected, assert.strictEqual(cb_occurred, cb_expected,
'events missing or out of order: "' + 'events missing or out of order: "' +
cb_occurred + '" !== "' + cb_expected + '"'); cb_occurred + '" !== "' + cb_expected + '"');
} else { } else {
console.log('ok'); console.log('ok');
} }

4
test/parallel/test-file-write-stream3.js

@ -24,8 +24,8 @@ process.on('exit', function() {
console.log(' expected: %j', cb_expected); console.log(' expected: %j', cb_expected);
console.log(' occurred: %j', cb_occurred); console.log(' occurred: %j', cb_occurred);
assert.strictEqual(cb_occurred, cb_expected, assert.strictEqual(cb_occurred, cb_expected,
'events missing or out of order: "' + 'events missing or out of order: "' +
cb_occurred + '" !== "' + cb_expected + '"'); cb_occurred + '" !== "' + cb_expected + '"');
} }
}); });

8
test/parallel/test-fs-realpath.js

@ -338,14 +338,14 @@ function test_escape_cwd(cb) {
console.log('test_escape_cwd'); console.log('test_escape_cwd');
asynctest(fs.realpath, ['..'], cb, function(er, uponeActual) { asynctest(fs.realpath, ['..'], cb, function(er, uponeActual) {
assert.equal(upone, uponeActual, assert.equal(upone, uponeActual,
'realpath("..") expected: ' + path.resolve(upone) + 'realpath("..") expected: ' + path.resolve(upone) +
' actual:' + uponeActual); ' actual:' + uponeActual);
}); });
} }
var uponeActual = fs.realpathSync('..'); var uponeActual = fs.realpathSync('..');
assert.equal(upone, uponeActual, assert.equal(upone, uponeActual,
'realpathSync("..") expected: ' + path.resolve(upone) + 'realpathSync("..") expected: ' + path.resolve(upone) +
' actual:' + uponeActual); ' actual:' + uponeActual);
// going up with .. multiple times // going up with .. multiple times

2
test/parallel/test-http-agent-error-on-idle.js

@ -47,7 +47,7 @@ server.listen(common.PORT, function() {
function done() { function done() {
assert.equal(Object.keys(agent.freeSockets).length, 0, assert.equal(Object.keys(agent.freeSockets).length, 0,
'expect the freeSockets pool to be empty'); 'expect the freeSockets pool to be empty');
agent.destroy(); agent.destroy();
server.close(); server.close();

2
test/parallel/test-http-agent-keepalive.js

@ -74,7 +74,7 @@ function remoteClose() {
setTimeout(function() { setTimeout(function() {
assert.equal(agent.sockets[name], undefined); assert.equal(agent.sockets[name], undefined);
assert.equal(agent.freeSockets[name], undefined, assert.equal(agent.freeSockets[name], undefined,
'freeSockets is not empty'); 'freeSockets is not empty');
remoteError(); remoteError();
}, common.platformTimeout(200)); }, common.platformTimeout(200));
}); });

2
test/parallel/test-http-agent-maxsockets.js

@ -30,7 +30,7 @@ function done() {
} }
var freepool = agent.freeSockets[Object.keys(agent.freeSockets)[0]]; var freepool = agent.freeSockets[Object.keys(agent.freeSockets)[0]];
assert.equal(freepool.length, 2, assert.equal(freepool.length, 2,
'expect keep 2 free sockets, but got ' + freepool.length); 'expect keep 2 free sockets, but got ' + freepool.length);
agent.destroy(); agent.destroy();
server.close(); server.close();
} }

4
test/parallel/test-http-destroyed-socket-write2.js

@ -42,8 +42,8 @@ server.listen(common.PORT, function() {
default: default:
assert.strictEqual(er.code, assert.strictEqual(er.code,
'ECONNRESET', 'ECONNRESET',
'Writing to a torn down client should RESET or ABORT'); 'Write to a torn down client should RESET or ABORT');
break; break;
} }

2
test/parallel/test-http-parser-bad-ref.js

@ -75,10 +75,12 @@ demoBug('POST /1', '/22 HTTP/1.1\r\n' +
'Content-Length: 4\r\n\r\n' + 'Content-Length: 4\r\n\r\n' +
'pong'); 'pong');
/* eslint-disable align-function-arguments */
demoBug('POST /1/22 HTTP/1.1\r\n' + demoBug('POST /1/22 HTTP/1.1\r\n' +
'Content-Type: tex', 't/plain\r\n' + 'Content-Type: tex', 't/plain\r\n' +
'Content-Length: 4\r\n\r\n' + 'Content-Length: 4\r\n\r\n' +
'pong'); 'pong');
/* eslint-enable align-function-arguments */
process.on('exit', function() { process.on('exit', function() {
assert.equal(2, headersComplete); assert.equal(2, headersComplete);

2
test/parallel/test-http-url.parse-post.js

@ -14,7 +14,7 @@ function check(request) {
assert.strictEqual(request.url, '/asdf?qwer=zxcv'); assert.strictEqual(request.url, '/asdf?qwer=zxcv');
//the host header should use the url.parse.hostname //the host header should use the url.parse.hostname
assert.strictEqual(request.headers.host, assert.strictEqual(request.headers.host,
testURL.hostname + ':' + testURL.port); testURL.hostname + ':' + testURL.port);
} }
var server = http.createServer(function(request, response) { var server = http.createServer(function(request, response) {

2
test/parallel/test-require-process.js

@ -4,4 +4,4 @@ var assert = require('assert');
var nativeProcess = require('process'); var nativeProcess = require('process');
assert.strictEqual(nativeProcess, process, assert.strictEqual(nativeProcess, process,
'require("process") should return a reference to global process'); 'require("process") should return global process reference');

2
test/parallel/test-timers-ordering.js

@ -19,7 +19,7 @@ var f = function(i) {
var now = Timer.now(); var now = Timer.now();
console.log(i, now); console.log(i, now);
assert(now >= last_ts + 1, assert(now >= last_ts + 1,
'current ts ' + now + ' < prev ts ' + last_ts + ' + 1'); 'current ts ' + now + ' < prev ts ' + last_ts + ' + 1');
last_ts = now; last_ts = now;
// schedule next iteration // schedule next iteration

4
test/parallel/test-timers-reset-process-domain-on-throw.js

@ -36,8 +36,8 @@ function secondTimer() {
// secondTimer was scheduled before any domain had been created, so its // secondTimer was scheduled before any domain had been created, so its
// callback should not have any active domain set when it runs. // callback should not have any active domain set when it runs.
if (process.domain !== null) { if (process.domain !== null) {
console.log('process.domain should be null in this timer callback, but ' + console.log('process.domain should be null in this timer callback, but is:',
'instead is:', process.domain); process.domain);
// Do not use assert here, as it throws errors and if a domain with an error // Do not use assert here, as it throws errors and if a domain with an error
// handler is active, then asserting wouldn't make the test fail. // handler is active, then asserting wouldn't make the test fail.
process.exit(1); process.exit(1);

16
test/parallel/test-zlib-convenience-methods.js

@ -23,8 +23,8 @@ var opts = {
zlib[method[0]](expect, opts, function(err, result) { zlib[method[0]](expect, opts, function(err, result) {
zlib[method[1]](result, opts, function(err, result) { zlib[method[1]](result, opts, function(err, result) {
assert.equal(result, expect, assert.equal(result, expect,
'Should get original string after ' + 'Should get original string after ' +
method[0] + '/' + method[1] + ' with options.'); method[0] + '/' + method[1] + ' with options.');
hadRun++; hadRun++;
}); });
}); });
@ -32,8 +32,8 @@ var opts = {
zlib[method[0]](expect, function(err, result) { zlib[method[0]](expect, function(err, result) {
zlib[method[1]](result, function(err, result) { zlib[method[1]](result, function(err, result) {
assert.equal(result, expect, assert.equal(result, expect,
'Should get original string after ' + 'Should get original string after ' +
method[0] + '/' + method[1] + ' without options.'); method[0] + '/' + method[1] + ' without options.');
hadRun++; hadRun++;
}); });
}); });
@ -41,15 +41,15 @@ var opts = {
var result = zlib[method[0] + 'Sync'](expect, opts); var result = zlib[method[0] + 'Sync'](expect, opts);
result = zlib[method[1] + 'Sync'](result, opts); result = zlib[method[1] + 'Sync'](result, opts);
assert.equal(result, expect, assert.equal(result, expect,
'Should get original string after ' + 'Should get original string after ' +
method[0] + '/' + method[1] + ' with options.'); method[0] + '/' + method[1] + ' with options.');
hadRun++; hadRun++;
result = zlib[method[0] + 'Sync'](expect); result = zlib[method[0] + 'Sync'](expect);
result = zlib[method[1] + 'Sync'](result); result = zlib[method[1] + 'Sync'](result);
assert.equal(result, expect, assert.equal(result, expect,
'Should get original string after ' + 'Should get original string after ' +
method[0] + '/' + method[1] + ' without options.'); method[0] + '/' + method[1] + ' without options.');
hadRun++; hadRun++;
}); });

8
test/parallel/test-zlib-flush-drain.js

@ -38,11 +38,11 @@ deflater.on('drain', function() {
process.once('exit', function() { process.once('exit', function() {
assert.equal(beforeFlush, true, assert.equal(beforeFlush, true,
'before calling flush the writable stream should need to drain'); 'before calling flush, writable stream should need to drain');
assert.equal(afterFlush, false, assert.equal(afterFlush, false,
'after calling flush the writable stream should not need to drain'); 'after calling flush, writable stream should not need to drain');
assert.equal(drainCount, 1, assert.equal(drainCount, 1,
'the deflater should have emitted a single drain event'); 'the deflater should have emitted a single drain event');
assert.equal(flushCount, 2, assert.equal(flushCount, 2,
'flush should be called twice'); 'flush should be called twice');
}); });

10
tools/doc/html.js

@ -11,11 +11,11 @@ module.exports = toHTML;
// TODO(chrisdickinson): never stop vomitting / fix this. // TODO(chrisdickinson): never stop vomitting / fix this.
var gtocPath = path.resolve(path.join( var gtocPath = path.resolve(path.join(
__dirname, __dirname,
'..', '..',
'..', '..',
'doc', 'doc',
'api', 'api',
'_toc.markdown' '_toc.markdown'
)); ));
var gtocLoading = null; var gtocLoading = null;
var gtocData = null; var gtocData = null;

Loading…
Cancel
Save