Skip to content

Commit 7e739ae

Browse files
TrottMyles Borins
authored and
Myles Borins
committed
test,tools: adjust function argument alignment
In preparation for a lint rule enforcing function argument alignment, adjust function arguments to be aligned. PR-URL: #7100 Refs: #6390 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Imran Iqbal <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ryan Graham <[email protected]>
1 parent 90306bb commit 7e739ae

25 files changed

+83
-63
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function launchChildProcess(index) {
9191
worker.pid, count);
9292

9393
assert.strictEqual(count, messages.length,
94-
'A worker received an invalid multicast message');
94+
'A worker received an invalid multicast message');
9595
});
9696

9797
clearTimeout(timer);

test/parallel/test-assert.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ try {
461461
} catch (e) {
462462
assert.equal(e.toString().split('\n')[0], 'AssertionError: oh no');
463463
assert.equal(e.generatedMessage, false,
464-
'Message incorrectly marked as generated');
464+
'Message incorrectly marked as generated');
465465
}
466466

467467
// Verify that throws() and doesNotThrow() throw on non-function block

test/parallel/test-buffer.js

+24-12
Original file line numberDiff line numberDiff line change
@@ -571,18 +571,30 @@ assert.equal(new Buffer('KioqKioqKioqKioqKioqKioqKio', 'base64').toString(),
571571
'********************');
572572

573573
// handle padding graciously, multiple-of-4 or not
574-
assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==',
575-
'base64').length, 32);
576-
assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=',
577-
'base64').length, 32);
578-
assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw',
579-
'base64').length, 32);
580-
assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==',
581-
'base64').length, 31);
582-
assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=',
583-
'base64').length, 31);
584-
assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg',
585-
'base64').length, 31);
574+
assert.equal(
575+
new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==', 'base64').length,
576+
32
577+
);
578+
assert.equal(
579+
new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=', 'base64').length,
580+
32
581+
);
582+
assert.equal(
583+
new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw', 'base64').length,
584+
32
585+
);
586+
assert.equal(
587+
new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==', 'base64').length,
588+
31
589+
);
590+
assert.equal(
591+
new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=', 'base64').length,
592+
31
593+
);
594+
assert.equal(
595+
new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg', 'base64').length,
596+
31
597+
);
586598

587599
// This string encodes single '.' character in UTF-16
588600
var dot = new Buffer('//4uAA==', 'base64');

test/parallel/test-cluster-basic.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var assert = require('assert');
44
var cluster = require('cluster');
55

66
assert.equal('NODE_UNIQUE_ID' in process.env, false,
7-
'NODE_UNIQUE_ID should be removed on startup');
7+
'NODE_UNIQUE_ID should be removed on startup');
88

99
function forEach(obj, fn) {
1010
Object.keys(obj).forEach(function(name, index) {
@@ -93,7 +93,7 @@ else if (cluster.isMaster) {
9393
worker = cluster.fork();
9494
assert.equal(worker.id, 1);
9595
assert.ok(worker instanceof cluster.Worker,
96-
'the worker is not a instance of the Worker constructor');
96+
'the worker is not a instance of the Worker constructor');
9797

9898
//Check event
9999
forEach(checks.worker.events, function(bool, name, index) {

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,11 @@ var a4 = crypto.createHash('sha1').update('Test123').digest('buffer');
347347

348348
if (!common.hasFipsCrypto) {
349349
var a0 = crypto.createHash('md5').update('Test123').digest('binary');
350-
assert.equal(a0, 'h\u00ea\u00cb\u0097\u00d8o\fF!\u00fa+\u000e\u0017\u00ca' +
351-
'\u00bd\u008c', 'Test MD5 as binary');
350+
assert.equal(
351+
a0,
352+
'h\u00ea\u00cb\u0097\u00d8o\fF!\u00fa+\u000e\u0017\u00ca\u00bd\u008c',
353+
'Test MD5 as binary'
354+
);
352355
}
353356

354357
assert.equal(a1, '8308651804facb7b9af8ffc53a33a22d6a1c8ac2', 'Test SHA1');

test/parallel/test-crypto-hash.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ a8 = a8.read();
3939

4040
if (!common.hasFipsCrypto) {
4141
var a0 = crypto.createHash('md5').update('Test123').digest('binary');
42-
assert.equal(a0, 'h\u00ea\u00cb\u0097\u00d8o\fF!\u00fa+\u000e\u0017\u00ca' +
43-
'\u00bd\u008c', 'Test MD5 as binary');
42+
assert.equal(
43+
a0,
44+
'h\u00ea\u00cb\u0097\u00d8o\fF!\u00fa+\u000e\u0017\u00ca\u00bd\u008c',
45+
'Test MD5 as binary'
46+
);
4447
}
4548
assert.equal(a1, '8308651804facb7b9af8ffc53a33a22d6a1c8ac2', 'Test SHA1');
4649
assert.equal(a2, '2bX1jws4GYKTlxhloUB09Z66PoJZW+y+hq5R8dnx9l4=',

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ setTimeout(function firstTimer() {
3838
d.dispose();
3939
console.error(err);
4040
console.error('in domain error handler',
41-
process.domain, process.domain === d);
41+
process.domain, process.domain === d);
4242
});
4343

4444
d.run(function() {

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ function runTestWithoutAbortOnUncaughtException() {
6262
'include domain\'s error\'s message');
6363

6464
assert.notEqual(err.code, 0,
65-
'child process should have exited with a non-zero exit code, ' +
66-
'but did not');
65+
'child process should have exited with a non-zero ' +
66+
'exit code, but did not');
6767
});
6868
}
6969

@@ -72,8 +72,8 @@ function runTestWithAbortOnUncaughtException() {
7272
withAbortOnUncaughtException: true
7373
}), function onTestDone(err, stdout, stderr) {
7474
assert.notEqual(err.code, RAN_UNCAUGHT_EXCEPTION_HANDLER_EXIT_CODE,
75-
'child process should not have run its uncaughtException event ' +
76-
'handler');
75+
'child process should not have run its uncaughtException ' +
76+
'event handler');
7777
assert(common.nodeProcessAborted(err.code, err.signal),
7878
'process should have aborted, but did not');
7979
});

test/parallel/test-domain-timers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ timeout = setTimeout(function() {}, 10 * 1000);
3434

3535
process.on('exit', function() {
3636
assert.equal(timeout_err.message, 'Timeout UNREFd',
37-
'Domain should catch timer error');
37+
'Domain should catch timer error');
3838
assert.equal(immediate_err.message, 'Immediate Error',
39-
'Domain should catch immediate error');
39+
'Domain should catch immediate error');
4040
});

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ d.on('error', common.mustCall(function() {
2323
// call to process._fatalException, and so on recursively and
2424
// indefinitely.
2525
console.error('domains stack length should be 1, but instead is:',
26-
domain._stack.length);
26+
domain._stack.length);
2727
process.exit(1);
2828
}
2929
});

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ process.on('exit', function() {
2424
console.log(' expected: %j', cb_expected);
2525
console.log(' occurred: %j', cb_occurred);
2626
assert.strictEqual(cb_occurred, cb_expected,
27-
'events missing or out of order: "' +
28-
cb_occurred + '" !== "' + cb_expected + '"');
27+
'events missing or out of order: "' +
28+
cb_occurred + '" !== "' + cb_expected + '"');
2929
} else {
3030
console.log('ok');
3131
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ process.on('exit', function() {
2424
console.log(' expected: %j', cb_expected);
2525
console.log(' occurred: %j', cb_occurred);
2626
assert.strictEqual(cb_occurred, cb_expected,
27-
'events missing or out of order: "' +
28-
cb_occurred + '" !== "' + cb_expected + '"');
27+
'events missing or out of order: "' +
28+
cb_occurred + '" !== "' + cb_expected + '"');
2929
}
3030
});
3131

test/parallel/test-fs-realpath.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,14 @@ function test_escape_cwd(cb) {
338338
console.log('test_escape_cwd');
339339
asynctest(fs.realpath, ['..'], cb, function(er, uponeActual) {
340340
assert.equal(upone, uponeActual,
341-
'realpath("..") expected: ' + path.resolve(upone) +
342-
' actual:' + uponeActual);
341+
'realpath("..") expected: ' + path.resolve(upone) +
342+
' actual:' + uponeActual);
343343
});
344344
}
345345
var uponeActual = fs.realpathSync('..');
346346
assert.equal(upone, uponeActual,
347-
'realpathSync("..") expected: ' + path.resolve(upone) +
348-
' actual:' + uponeActual);
347+
'realpathSync("..") expected: ' + path.resolve(upone) +
348+
' actual:' + uponeActual);
349349

350350

351351
// going up with .. multiple times

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ server.listen(common.PORT, function() {
4747

4848
function done() {
4949
assert.equal(Object.keys(agent.freeSockets).length, 0,
50-
'expect the freeSockets pool to be empty');
50+
'expect the freeSockets pool to be empty');
5151

5252
agent.destroy();
5353
server.close();

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function remoteClose() {
7474
setTimeout(function() {
7575
assert.equal(agent.sockets[name], undefined);
7676
assert.equal(agent.freeSockets[name], undefined,
77-
'freeSockets is not empty');
77+
'freeSockets is not empty');
7878
remoteError();
7979
}, common.platformTimeout(200));
8080
});

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function done() {
3030
}
3131
var freepool = agent.freeSockets[Object.keys(agent.freeSockets)[0]];
3232
assert.equal(freepool.length, 2,
33-
'expect keep 2 free sockets, but got ' + freepool.length);
33+
'expect keep 2 free sockets, but got ' + freepool.length);
3434
agent.destroy();
3535
server.close();
3636
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ server.listen(common.PORT, function() {
4242

4343
default:
4444
assert.strictEqual(er.code,
45-
'ECONNRESET',
46-
'Writing to a torn down client should RESET or ABORT');
45+
'ECONNRESET',
46+
'Write to a torn down client should RESET or ABORT');
4747
break;
4848
}
4949

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

+2
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ demoBug('POST /1', '/22 HTTP/1.1\r\n' +
7575
'Content-Length: 4\r\n\r\n' +
7676
'pong');
7777

78+
/* eslint-disable align-function-arguments */
7879
demoBug('POST /1/22 HTTP/1.1\r\n' +
7980
'Content-Type: tex', 't/plain\r\n' +
8081
'Content-Length: 4\r\n\r\n' +
8182
'pong');
83+
/* eslint-enable align-function-arguments */
8284

8385
process.on('exit', function() {
8486
assert.equal(2, headersComplete);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function check(request) {
1414
assert.strictEqual(request.url, '/asdf?qwer=zxcv');
1515
//the host header should use the url.parse.hostname
1616
assert.strictEqual(request.headers.host,
17-
testURL.hostname + ':' + testURL.port);
17+
testURL.hostname + ':' + testURL.port);
1818
}
1919

2020
var server = http.createServer(function(request, response) {

test/parallel/test-require-process.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ var assert = require('assert');
44

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

test/parallel/test-timers-ordering.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var f = function(i) {
1919
var now = Timer.now();
2020
console.log(i, now);
2121
assert(now >= last_ts + 1,
22-
'current ts ' + now + ' < prev ts ' + last_ts + ' + 1');
22+
'current ts ' + now + ' < prev ts ' + last_ts + ' + 1');
2323
last_ts = now;
2424

2525
// schedule next iteration

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

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

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,33 @@ var opts = {
2323
zlib[method[0]](expect, opts, function(err, result) {
2424
zlib[method[1]](result, opts, function(err, result) {
2525
assert.equal(result, expect,
26-
'Should get original string after ' +
27-
method[0] + '/' + method[1] + ' with options.');
26+
'Should get original string after ' +
27+
method[0] + '/' + method[1] + ' with options.');
2828
hadRun++;
2929
});
3030
});
3131

3232
zlib[method[0]](expect, function(err, result) {
3333
zlib[method[1]](result, function(err, result) {
3434
assert.equal(result, expect,
35-
'Should get original string after ' +
36-
method[0] + '/' + method[1] + ' without options.');
35+
'Should get original string after ' +
36+
method[0] + '/' + method[1] + ' without options.');
3737
hadRun++;
3838
});
3939
});
4040

4141
var result = zlib[method[0] + 'Sync'](expect, opts);
4242
result = zlib[method[1] + 'Sync'](result, opts);
4343
assert.equal(result, expect,
44-
'Should get original string after ' +
45-
method[0] + '/' + method[1] + ' with options.');
44+
'Should get original string after ' +
45+
method[0] + '/' + method[1] + ' with options.');
4646
hadRun++;
4747

4848
result = zlib[method[0] + 'Sync'](expect);
4949
result = zlib[method[1] + 'Sync'](result);
5050
assert.equal(result, expect,
51-
'Should get original string after ' +
52-
method[0] + '/' + method[1] + ' without options.');
51+
'Should get original string after ' +
52+
method[0] + '/' + method[1] + ' without options.');
5353
hadRun++;
5454

5555
});

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ deflater.on('drain', function() {
3838

3939
process.once('exit', function() {
4040
assert.equal(beforeFlush, true,
41-
'before calling flush the writable stream should need to drain');
41+
'before calling flush, writable stream should need to drain');
4242
assert.equal(afterFlush, false,
43-
'after calling flush the writable stream should not need to drain');
43+
'after calling flush, writable stream should not need to drain');
4444
assert.equal(drainCount, 1,
45-
'the deflater should have emitted a single drain event');
45+
'the deflater should have emitted a single drain event');
4646
assert.equal(flushCount, 2,
47-
'flush should be called twice');
47+
'flush should be called twice');
4848
});

tools/doc/html.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ module.exports = toHTML;
1111
// TODO(chrisdickinson): never stop vomitting / fix this.
1212
var gtocPath = path.resolve(path.join(
1313
__dirname,
14-
'..',
15-
'..',
16-
'doc',
17-
'api',
18-
'_toc.markdown'
14+
'..',
15+
'..',
16+
'doc',
17+
'api',
18+
'_toc.markdown'
1919
));
2020
var gtocLoading = null;
2121
var gtocData = null;

0 commit comments

Comments
 (0)