Skip to content

Commit 6d1606e

Browse files
TrottFishrock123
authored andcommitted
test,tools: adjust function argument alignment
In preparation for a lint rule enforcing function argument alignment, adjust function arguments to be aligned. PR-URL: #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 fdde369 commit 6d1606e

29 files changed

+111
-79
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
@@ -462,7 +462,7 @@ try {
462462
} catch (e) {
463463
assert.equal(e.toString().split('\n')[0], 'AssertionError: oh no');
464464
assert.equal(e.generatedMessage, false,
465-
'Message incorrectly marked as generated');
465+
'Message incorrectly marked as generated');
466466
}
467467

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

test/parallel/test-buffer-alloc.js

+24-12
Original file line numberDiff line numberDiff line change
@@ -645,18 +645,30 @@ assert.equal(Buffer.from('KioqKioqKioqKioqKioqKioqKio', 'base64').toString(),
645645
'********************');
646646

647647
// handle padding graciously, multiple-of-4 or not
648-
assert.equal(Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==',
649-
'base64').length, 32);
650-
assert.equal(Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=',
651-
'base64').length, 32);
652-
assert.equal(Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw',
653-
'base64').length, 32);
654-
assert.equal(Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==',
655-
'base64').length, 31);
656-
assert.equal(Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=',
657-
'base64').length, 31);
658-
assert.equal(Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg',
659-
'base64').length, 31);
648+
assert.equal(
649+
Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==', 'base64').length,
650+
32
651+
);
652+
assert.equal(
653+
Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=', 'base64').length,
654+
32
655+
);
656+
assert.equal(
657+
Buffer.from('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw', 'base64').length,
658+
32
659+
);
660+
assert.equal(
661+
Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==', 'base64').length,
662+
31
663+
);
664+
assert.equal(
665+
Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=', 'base64').length,
666+
31
667+
);
668+
assert.equal(
669+
Buffer.from('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg', 'base64').length,
670+
31
671+
);
660672

661673
// This string encodes single '.' character in UTF-16
662674
var dot = Buffer.from('//4uAA==', 'base64');

test/parallel/test-buffer.js

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

645645
// handle padding graciously, multiple-of-4 or not
646-
assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==',
647-
'base64').length, 32);
648-
assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=',
649-
'base64').length, 32);
650-
assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw',
651-
'base64').length, 32);
652-
assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==',
653-
'base64').length, 31);
654-
assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=',
655-
'base64').length, 31);
656-
assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg',
657-
'base64').length, 31);
646+
assert.equal(
647+
new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==', 'base64').length,
648+
32
649+
);
650+
assert.equal(
651+
new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=', 'base64').length,
652+
32
653+
);
654+
assert.equal(
655+
new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw', 'base64').length,
656+
32
657+
);
658+
assert.equal(
659+
new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==', 'base64').length,
660+
31
661+
);
662+
assert.equal(
663+
new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=', 'base64').length,
664+
31
665+
);
666+
assert.equal(
667+
new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg', 'base64').length,
668+
31
669+
);
658670

659671
// This string encodes single '.' character in UTF-16
660672
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-stack-empty-in-process-uncaughtexception.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ const d = domain.create();
88

99
process.on('uncaughtException', common.mustCall(function onUncaught() {
1010
assert.equal(process.domain, null,
11-
'domains stack should be empty in uncaughtException handler');
11+
'domains stack should be empty in uncaughtException handler');
1212
}));
1313

1414
process.on('beforeExit', common.mustCall(function onBeforeExit() {
1515
assert.equal(process.domain, null,
16-
'domains stack should be empty in beforeExit handler');
16+
'domains stack should be empty in beforeExit handler');
1717
}));
1818

1919
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
@@ -342,14 +342,14 @@ function test_escape_cwd(cb) {
342342
console.log('test_escape_cwd');
343343
asynctest(fs.realpath, ['..'], cb, function(er, uponeActual) {
344344
assertEqualPath(upone, uponeActual,
345-
'realpath("..") expected: ' + path.resolve(upone) +
346-
' actual:' + uponeActual);
345+
'realpath("..") expected: ' + path.resolve(upone) +
346+
' actual:' + uponeActual);
347347
});
348348
}
349349
var uponeActual = fs.realpathSync('..');
350350
assertEqualPath(upone, uponeActual,
351-
'realpathSync("..") expected: ' + path.resolve(upone) +
352-
' actual:' + uponeActual);
351+
'realpathSync("..") expected: ' + path.resolve(upone) +
352+
' actual:' + uponeActual);
353353

354354

355355
// 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
@@ -37,8 +37,8 @@ server.listen(common.PORT, function() {
3737
break;
3838
default:
3939
assert.strictEqual(er.code,
40-
'ECONNRESET',
41-
'Writing to a torn down client should RESET or ABORT');
40+
'ECONNRESET',
41+
'Write to a torn down client should RESET or ABORT');
4242
break;
4343
}
4444

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-module-relative-lookup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ const lookupResults = _module._resolveLookupPaths('./lodash');
77
const paths = lookupResults[1];
88

99
assert.strictEqual(paths[0], '.',
10-
'Current directory is prioritized before node_modules for local modules');
10+
'Current directory gets highest priority for local modules');

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-tls-peer-certificate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ server.listen(common.PORT, function() {
4141
assert.equal(peerCert.fingerprint,
4242
'8D:06:3A:B3:E5:8B:85:29:72:4F:7D:1B:54:CD:95:19:3C:EF:6F:AA');
4343
assert.deepStrictEqual(peerCert.infoAccess['OCSP - URI'],
44-
[ 'http://ocsp.nodejs.org/' ]);
44+
[ 'http://ocsp.nodejs.org/' ]);
4545

4646
var issuer = peerCert.issuerCertificate;
4747
assert.ok(issuer.issuerCertificate === issuer);

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
});

0 commit comments

Comments
 (0)