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. 36
      test/parallel/test-buffer.js
  2. 7
      test/parallel/test-crypto-binary-default.js
  3. 7
      test/parallel/test-crypto-hash.js
  4. 8
      test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js
  5. 2
      test/parallel/test-http-destroyed-socket-write2.js
  6. 2
      test/parallel/test-http-parser-bad-ref.js
  7. 2
      test/parallel/test-require-process.js
  8. 4
      test/parallel/test-timers-reset-process-domain-on-throw.js
  9. 4
      test/parallel/test-zlib-flush-drain.js

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

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=',

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

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

@ -43,7 +43,7 @@ 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-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');

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

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

@ -38,9 +38,9 @@ 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,

Loading…
Cancel
Save