lib,test,tools: alignment on variable assignments
Correct alignment on variable assignments that span multiple lines in preparation for lint rule to enforce such alignment. PR-URL: https://github.com/nodejs/node/pull/6242 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
c1d82ac2ff
commit
31600735f4
@ -463,9 +463,10 @@ function checkExecSyncError(ret) {
|
||||
ret.error = null;
|
||||
|
||||
if (!err) {
|
||||
var msg = 'Command failed: ' +
|
||||
(ret.cmd ? ret.cmd : ret.args.join(' ')) +
|
||||
(ret.stderr ? '\n' + ret.stderr.toString() : '');
|
||||
var msg = 'Command failed: ';
|
||||
msg += ret.cmd || ret.args.join(' ');
|
||||
if (ret.stderr)
|
||||
msg += '\n' + ret.stderr.toString();
|
||||
err = new Error(msg);
|
||||
}
|
||||
|
||||
|
@ -67,8 +67,8 @@ exports.writer = util.inspect;
|
||||
exports._builtinLibs = internalModule.builtinLibs;
|
||||
|
||||
|
||||
const BLOCK_SCOPED_ERROR = 'Block-scoped declarations (let, ' +
|
||||
'const, function, class) not yet supported outside strict mode';
|
||||
const BLOCK_SCOPED_ERROR = 'Block-scoped declarations (let, const, function, ' +
|
||||
'class) not yet supported outside strict mode';
|
||||
|
||||
|
||||
class LineParser {
|
||||
|
@ -497,9 +497,12 @@ function formatPrimitive(ctx, value) {
|
||||
var type = typeof value;
|
||||
|
||||
if (type === 'string') {
|
||||
var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
|
||||
var simple = '\'' +
|
||||
JSON.stringify(value)
|
||||
.replace(/^"|"$/g, '')
|
||||
.replace(/'/g, "\\'")
|
||||
.replace(/\\"/g, '"') + '\'';
|
||||
.replace(/\\"/g, '"') +
|
||||
'\'';
|
||||
return ctx.stylize(simple, 'string');
|
||||
}
|
||||
if (type === 'number')
|
||||
|
@ -6,8 +6,8 @@ const binding = process.binding('zlib');
|
||||
const util = require('util');
|
||||
const assert = require('assert').ok;
|
||||
const kMaxLength = require('buffer').kMaxLength;
|
||||
const kRangeErrorMessage = 'Cannot create final Buffer. ' +
|
||||
'It would be larger than 0x' + kMaxLength.toString(16) + ' bytes';
|
||||
const kRangeErrorMessage = 'Cannot create final Buffer. It would be larger ' +
|
||||
'than 0x' + kMaxLength.toString(16) + ' bytes';
|
||||
|
||||
// zlib doesn't provide these, so kludge them in following the same
|
||||
// const naming scheme zlib uses.
|
||||
|
@ -537,15 +537,15 @@ assert.equal('TWFu', (Buffer.from('Man')).toString('base64'));
|
||||
const quote = 'Man is distinguished, not only by his reason, but by this ' +
|
||||
'singular passion from other animals, which is a lust ' +
|
||||
'of the mind, that by a perseverance of delight in the ' +
|
||||
'continued and indefatigable generation of knowledge, exceeds ' +
|
||||
'the short vehemence of any carnal pleasure.';
|
||||
'continued and indefatigable generation of knowledge, ' +
|
||||
'exceeds the short vehemence of any carnal pleasure.';
|
||||
const expected = 'TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb' +
|
||||
'24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBh' +
|
||||
'bmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnk' +
|
||||
'gYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIG' +
|
||||
'FuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBle' +
|
||||
'GNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVh' +
|
||||
'c3VyZS4=';
|
||||
'24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlci' +
|
||||
'BhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQ' +
|
||||
'gYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu' +
|
||||
'dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZ' +
|
||||
'GdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm' +
|
||||
'5hbCBwbGVhc3VyZS4=';
|
||||
assert.equal(expected, (Buffer.from(quote)).toString('base64'));
|
||||
|
||||
let b = Buffer.allocUnsafe(1024);
|
||||
|
@ -535,15 +535,15 @@ assert.equal('TWFu', (new Buffer('Man')).toString('base64'));
|
||||
const quote = 'Man is distinguished, not only by his reason, but by this ' +
|
||||
'singular passion from other animals, which is a lust ' +
|
||||
'of the mind, that by a perseverance of delight in the ' +
|
||||
'continued and indefatigable generation of knowledge, exceeds ' +
|
||||
'the short vehemence of any carnal pleasure.';
|
||||
'continued and indefatigable generation of knowledge, ' +
|
||||
'exceeds the short vehemence of any carnal pleasure.';
|
||||
const expected = 'TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb' +
|
||||
'24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBh' +
|
||||
'bmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnk' +
|
||||
'gYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIG' +
|
||||
'FuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBle' +
|
||||
'GNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVh' +
|
||||
'c3VyZS4=';
|
||||
'24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlci' +
|
||||
'BhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQ' +
|
||||
'gYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu' +
|
||||
'dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZ' +
|
||||
'GdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm' +
|
||||
'5hbCBwbGVhc3VyZS4=';
|
||||
assert.equal(expected, (new Buffer(quote)).toString('base64'));
|
||||
|
||||
let b = new Buffer(1024);
|
||||
|
@ -160,8 +160,8 @@ if (process.argv[2] === 'child') {
|
||||
|
||||
child.on('exit', function onExit(exitCode, signal) {
|
||||
const errMsg = 'Test at index ' + testIndex + ' should have aborted ' +
|
||||
'but instead exited with exit code ' + exitCode + ' and signal ' +
|
||||
signal;
|
||||
'but instead exited with exit code ' + exitCode +
|
||||
' and signal ' + signal;
|
||||
assert(common.nodeProcessAborted(exitCode, signal), errMsg);
|
||||
});
|
||||
});
|
||||
|
@ -88,11 +88,11 @@ function test(handler, request_generator, response_validator) {
|
||||
}
|
||||
|
||||
function response_validator(server_response, client_got_eof, timed_out) {
|
||||
var expected_response = ('HTTP/1.1 200 OK\r\n' +
|
||||
var expected_response = 'HTTP/1.1 200 OK\r\n' +
|
||||
'Content-Type: text/plain\r\n' +
|
||||
'Connection: close\r\n' +
|
||||
'\r\n' +
|
||||
'Hello, world!');
|
||||
'Hello, world!';
|
||||
|
||||
assert.equal(expected_response, server_response);
|
||||
assert.equal(true, client_got_eof);
|
||||
@ -125,7 +125,7 @@ function test(handler, request_generator, response_validator) {
|
||||
}
|
||||
|
||||
function response_validator(server_response, client_got_eof, timed_out) {
|
||||
var expected_response = ('HTTP/1.1 200 OK\r\n' +
|
||||
var expected_response = 'HTTP/1.1 200 OK\r\n' +
|
||||
'Content-Type: text/plain\r\n' +
|
||||
'Connection: close\r\n' +
|
||||
'Transfer-Encoding: chunked\r\n' +
|
||||
@ -135,7 +135,7 @@ function test(handler, request_generator, response_validator) {
|
||||
'6\r\n' +
|
||||
'world!\r\n' +
|
||||
'0\r\n' +
|
||||
'\r\n');
|
||||
'\r\n';
|
||||
|
||||
assert.equal(expected_response, server_response);
|
||||
assert.equal(true, client_got_eof);
|
||||
|
@ -128,12 +128,11 @@ const trailingTests = [
|
||||
const failures = [];
|
||||
trailingTests.forEach(function(test) {
|
||||
const parse = test[0];
|
||||
const os = parse === path.win32.parse ? 'win32' : 'posix';
|
||||
test[1].forEach(function(test) {
|
||||
const actual = parse(test[0]);
|
||||
const expected = test[1];
|
||||
const fn = 'path.' +
|
||||
(parse === path.win32.parse ? 'win32' : 'posix') +
|
||||
'.parse(';
|
||||
const fn = `path.${os}.parse(`;
|
||||
const message = fn +
|
||||
JSON.stringify(test[0]) +
|
||||
')' +
|
||||
|
@ -155,13 +155,16 @@ assert.throws(path.win32.dirname.bind(null, {}), TypeError);
|
||||
].forEach(function(test) {
|
||||
[path.posix.extname, path.win32.extname].forEach(function(extname) {
|
||||
let input = test[0];
|
||||
if (extname === path.win32.extname)
|
||||
let os;
|
||||
if (extname === path.win32.extname) {
|
||||
input = input.replace(/\//g, '\\');
|
||||
os = 'win32';
|
||||
} else {
|
||||
os = 'posix';
|
||||
}
|
||||
const actual = extname(input);
|
||||
const expected = test[1];
|
||||
const fn = 'path.' +
|
||||
(extname === path.win32.extname ? 'win32' : 'posix') +
|
||||
'.extname(';
|
||||
const fn = `path.${os}.extname(`;
|
||||
const message = fn + JSON.stringify(input) + ')' +
|
||||
'\n expect=' + JSON.stringify(expected) +
|
||||
'\n actual=' + JSON.stringify(actual);
|
||||
@ -319,11 +322,15 @@ joinTests.forEach(function(test) {
|
||||
// For non-Windows specific tests with the Windows join(), we need to try
|
||||
// replacing the slashes since the non-Windows specific tests' `expected`
|
||||
// use forward slashes
|
||||
const actualAlt = (join === path.win32.join) ?
|
||||
actual.replace(/\\/g, '/') : undefined;
|
||||
const fn = 'path.' +
|
||||
(join === path.win32.join ? 'win32' : 'posix') +
|
||||
'.join(';
|
||||
let actualAlt;
|
||||
let os;
|
||||
if (join === path.win32.join) {
|
||||
actualAlt = actual.replace(/\\/g, '/');
|
||||
os = 'win32';
|
||||
} else {
|
||||
os = 'posix';
|
||||
}
|
||||
const fn = `path.${os}.join(`;
|
||||
const message = fn + test[0].map(JSON.stringify).join(',') + ')' +
|
||||
'\n expect=' + JSON.stringify(expected) +
|
||||
'\n actual=' + JSON.stringify(actual);
|
||||
@ -423,14 +430,14 @@ resolveTests.forEach(function(test) {
|
||||
test[1].forEach(function(test) {
|
||||
const actual = resolve.apply(null, test[0]);
|
||||
let actualAlt;
|
||||
const os = resolve === path.win32.resolve ? 'win32' : 'posix';
|
||||
if (resolve === path.win32.resolve && !common.isWindows)
|
||||
actualAlt = actual.replace(/\\/g, '/');
|
||||
else if (resolve !== path.win32.resolve && common.isWindows)
|
||||
actualAlt = actual.replace(/\//g, '\\');
|
||||
|
||||
const expected = test[1];
|
||||
const fn = 'path.' +
|
||||
(resolve === path.win32.resolve ? 'win32' : 'posix') +
|
||||
'.resolve(';
|
||||
const fn = `path.${os}.resolve(`;
|
||||
const message = fn + test[0].map(JSON.stringify).join(',') + ')' +
|
||||
'\n expect=' + JSON.stringify(expected) +
|
||||
'\n actual=' + JSON.stringify(actual);
|
||||
@ -517,9 +524,8 @@ relativeTests.forEach(function(test) {
|
||||
test[1].forEach(function(test) {
|
||||
const actual = relative(test[0], test[1]);
|
||||
const expected = test[2];
|
||||
const fn = 'path.' +
|
||||
(relative === path.win32.relative ? 'win32' : 'posix') +
|
||||
'.relative(';
|
||||
const os = relative === path.win32.relative ? 'win32' : 'posix';
|
||||
const fn = `path.${os}.relative(`;
|
||||
const message = fn +
|
||||
test.slice(0, 2).map(JSON.stringify).join(',') +
|
||||
')' +
|
||||
|
@ -9,26 +9,29 @@ if (!common.hasCrypto) {
|
||||
var tls = require('tls');
|
||||
|
||||
|
||||
var cert = '-----BEGIN CERTIFICATE-----\n' +
|
||||
'MIIBfjCCASgCCQDmmNjAojbDQjANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB\n' +
|
||||
'VTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0\n' +
|
||||
'cyBQdHkgTHRkMCAXDTE0MDExNjE3NTMxM1oYDzIyODcxMDMxMTc1MzEzWjBFMQsw\n' +
|
||||
'CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu\n' +
|
||||
'ZXQgV2lkZ2l0cyBQdHkgTHRkMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAPKwlfMX\n' +
|
||||
'6HGZIt1xm7fna72eWcOYfUfSxSugghvqYgJt2Oi3lH+wsU1O9FzRIVmpeIjDXhbp\n' +
|
||||
'Mjsa1HtzSiccPXsCAwEAATANBgkqhkiG9w0BAQUFAANBAHOoKy0NkyfiYH7Ne5ka\n' +
|
||||
'uvCyndyeB4d24FlfqEUlkfaWCZlNKRaV9YhLDiEg3BcIreFo4brtKQfZzTRs0GVm\n' +
|
||||
'KHg=\n' +
|
||||
'-----END CERTIFICATE-----';
|
||||
var key = '-----BEGIN RSA PRIVATE KEY-----\n' +
|
||||
'MIIBPQIBAAJBAPKwlfMX6HGZIt1xm7fna72eWcOYfUfSxSugghvqYgJt2Oi3lH+w\n' +
|
||||
'sU1O9FzRIVmpeIjDXhbpMjsa1HtzSiccPXsCAwEAAQJBAM4uU9aJE0OfdE1p/X+K\n' +
|
||||
'LrCT3XMdFCJ24GgmHyOURtwDy18upQJecDVdcZp16fjtOPmaW95GoYRyifB3R4I5\n' +
|
||||
'RxECIQD7jRM9slCSVV8xp9kOJQNpHjhRQYVGBn+pyllS2sb+RQIhAPb7Y+BIccri\n' +
|
||||
'NWnuhwCW8hA7Fkj/kaBdAwyW7L3Tvui/AiEAiqLCovMecre4Yi6GcsQ1b/6mvSmm\n' +
|
||||
'IOS+AT6zIfXPTB0CIQCJKGR3ymN/Qw5crL1GQ41cHCQtF9ickOq/lBUW+j976wIh\n' +
|
||||
'AOaJnkQrmurlRdePX6LvN/LgGAQoxwovfjcOYNnZsIVY\n' +
|
||||
'-----END RSA PRIVATE KEY-----';
|
||||
var cert =
|
||||
`-----BEGIN CERTIFICATE-----
|
||||
MIIBfjCCASgCCQDmmNjAojbDQjANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB
|
||||
VTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0
|
||||
cyBQdHkgTHRkMCAXDTE0MDExNjE3NTMxM1oYDzIyODcxMDMxMTc1MzEzWjBFMQsw
|
||||
CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu
|
||||
ZXQgV2lkZ2l0cyBQdHkgTHRkMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAPKwlfMX
|
||||
6HGZIt1xm7fna72eWcOYfUfSxSugghvqYgJt2Oi3lH+wsU1O9FzRIVmpeIjDXhbp
|
||||
Mjsa1HtzSiccPXsCAwEAATANBgkqhkiG9w0BAQUFAANBAHOoKy0NkyfiYH7Ne5ka
|
||||
uvCyndyeB4d24FlfqEUlkfaWCZlNKRaV9YhLDiEg3BcIreFo4brtKQfZzTRs0GVm
|
||||
KHg=
|
||||
-----END CERTIFICATE-----`;
|
||||
|
||||
var key =
|
||||
`-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIBPQIBAAJBAPKwlfMX6HGZIt1xm7fna72eWcOYfUfSxSugghvqYgJt2Oi3lH+w
|
||||
sU1O9FzRIVmpeIjDXhbpMjsa1HtzSiccPXsCAwEAAQJBAM4uU9aJE0OfdE1p/X+K
|
||||
LrCT3XMdFCJ24GgmHyOURtwDy18upQJecDVdcZp16fjtOPmaW95GoYRyifB3R4I5
|
||||
RxECIQD7jRM9slCSVV8xp9kOJQNpHjhRQYVGBn+pyllS2sb+RQIhAPb7Y+BIccri
|
||||
NWnuhwCW8hA7Fkj/kaBdAwyW7L3Tvui/AiEAiqLCovMecre4Yi6GcsQ1b/6mvSmm
|
||||
IOS+AT6zIfXPTB0CIQCJKGR3ymN/Qw5crL1GQ41cHCQtF9ickOq/lBUW+j976wIh
|
||||
AOaJnkQrmurlRdePX6LvN/LgGAQoxwovfjcOYNnZsIVY
|
||||
-----END RSA PRIVATE KEY-----`;
|
||||
|
||||
function test(cert, key, cb) {
|
||||
var server = tls.createServer({
|
||||
|
@ -8,38 +8,41 @@ if (!common.hasCrypto) {
|
||||
}
|
||||
var tls = require('tls');
|
||||
|
||||
var cacert = '-----BEGIN CERTIFICATE-----\n' +
|
||||
'MIIBxTCCAX8CAnXnMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD\n' +
|
||||
'VQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQU3Ryb25n\n' +
|
||||
'TG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRowGAYDVQQDExFjYS5zdHJv\n' +
|
||||
'bmdsb29wLmNvbTAeFw0xNDAxMTcyMjE1MDdaFw00MTA2MDMyMjE1MDdaMH0xCzAJ\n' +
|
||||
'BgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZ\n' +
|
||||
'MBcGA1UEChMQU3Ryb25nTG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRow\n' +
|
||||
'GAYDVQQDExFjYS5zdHJvbmdsb29wLmNvbTBMMA0GCSqGSIb3DQEBAQUAAzsAMDgC\n' +
|
||||
'MQDKbQ6rIR5t1q1v4Ha36jrq0IkyUohy9EYNvLnXUly1PGqxby0ILlAVJ8JawpY9\n' +
|
||||
'AVkCAwEAATANBgkqhkiG9w0BAQUFAAMxALA1uS4CqQXRSAyYTfio5oyLGz71a+NM\n' +
|
||||
'+0AFLBwh5AQjhGd0FcenU4OfHxyDEOJT/Q==\n' +
|
||||
'-----END CERTIFICATE-----\n';
|
||||
var cacert =
|
||||
`-----BEGIN CERTIFICATE-----
|
||||
MIIBxTCCAX8CAnXnMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD
|
||||
VQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQU3Ryb25n
|
||||
TG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRowGAYDVQQDExFjYS5zdHJv
|
||||
bmdsb29wLmNvbTAeFw0xNDAxMTcyMjE1MDdaFw00MTA2MDMyMjE1MDdaMH0xCzAJ
|
||||
BgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZ
|
||||
MBcGA1UEChMQU3Ryb25nTG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRow
|
||||
GAYDVQQDExFjYS5zdHJvbmdsb29wLmNvbTBMMA0GCSqGSIb3DQEBAQUAAzsAMDgC
|
||||
MQDKbQ6rIR5t1q1v4Ha36jrq0IkyUohy9EYNvLnXUly1PGqxby0ILlAVJ8JawpY9
|
||||
AVkCAwEAATANBgkqhkiG9w0BAQUFAAMxALA1uS4CqQXRSAyYTfio5oyLGz71a+NM
|
||||
+0AFLBwh5AQjhGd0FcenU4OfHxyDEOJT/Q==
|
||||
-----END CERTIFICATE-----`;
|
||||
|
||||
var cert = '-----BEGIN CERTIFICATE-----\n' +
|
||||
'MIIBfDCCATYCAgQaMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD\n' +
|
||||
'VQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQU3Ryb25n\n' +
|
||||
'TG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRowGAYDVQQDExFjYS5zdHJv\n' +
|
||||
'bmdsb29wLmNvbTAeFw0xNDAxMTcyMjE1MDdaFw00MTA2MDMyMjE1MDdaMBkxFzAV\n' +
|
||||
'BgNVBAMTDnN0cm9uZ2xvb3AuY29tMEwwDQYJKoZIhvcNAQEBBQADOwAwOAIxAMfk\n' +
|
||||
'I0LWU15pPUwIQNMnRVhhOibi0TQmAau8FBtgwEfGK01WpfGUaJr1a41K8Uq7xwID\n' +
|
||||
'AQABoxkwFzAVBgNVHREEDjAMhwQAAAAAhwR/AAABMA0GCSqGSIb3DQEBBQUAAzEA\n' +
|
||||
'cGpYrhkrb7mIh9DNhV0qp7pGjqBzlHqB7KQXw2luLDp//6dyHBMexDCQznkhZKRU\n' +
|
||||
'-----END CERTIFICATE-----\n';
|
||||
var cert =
|
||||
`-----BEGIN CERTIFICATE-----
|
||||
MIIBfDCCATYCAgQaMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD
|
||||
VQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQU3Ryb25n
|
||||
TG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRowGAYDVQQDExFjYS5zdHJv
|
||||
bmdsb29wLmNvbTAeFw0xNDAxMTcyMjE1MDdaFw00MTA2MDMyMjE1MDdaMBkxFzAV
|
||||
BgNVBAMTDnN0cm9uZ2xvb3AuY29tMEwwDQYJKoZIhvcNAQEBBQADOwAwOAIxAMfk
|
||||
I0LWU15pPUwIQNMnRVhhOibi0TQmAau8FBtgwEfGK01WpfGUaJr1a41K8Uq7xwID
|
||||
AQABoxkwFzAVBgNVHREEDjAMhwQAAAAAhwR/AAABMA0GCSqGSIb3DQEBBQUAAzEA
|
||||
cGpYrhkrb7mIh9DNhV0qp7pGjqBzlHqB7KQXw2luLDp//6dyHBMexDCQznkhZKRU
|
||||
-----END CERTIFICATE-----`;
|
||||
|
||||
var key = '-----BEGIN RSA PRIVATE KEY-----\n' +
|
||||
'MIH0AgEAAjEAx+QjQtZTXmk9TAhA0ydFWGE6JuLRNCYBq7wUG2DAR8YrTVal8ZRo\n' +
|
||||
'mvVrjUrxSrvHAgMBAAECMBCGccvSwC2r8Z9Zh1JtirQVxaL1WWpAQfmVwLe0bAgg\n' +
|
||||
'/JWMU/6hS36TsYyZMxwswQIZAPTAfht/zDLb7Hwgu2twsS1Ra9w/yyvtlwIZANET\n' +
|
||||
'26votwJAHK1yUrZGA5nnp5qcmQ/JUQIZAII5YV/UUZvF9D/fUplJ7puENPWNY9bN\n' +
|
||||
'pQIZAMMwxuS3XiO7two2sQF6W+JTYyX1DPCwAQIZAOYg1TvEGT38k8e8jygv8E8w\n' +
|
||||
'YqrWTeQFNQ==\n' +
|
||||
'-----END RSA PRIVATE KEY-----\n';
|
||||
var key =
|
||||
`-----BEGIN RSA PRIVATE KEY-----
|
||||
MIH0AgEAAjEAx+QjQtZTXmk9TAhA0ydFWGE6JuLRNCYBq7wUG2DAR8YrTVal8ZRo
|
||||
mvVrjUrxSrvHAgMBAAECMBCGccvSwC2r8Z9Zh1JtirQVxaL1WWpAQfmVwLe0bAgg
|
||||
/JWMU/6hS36TsYyZMxwswQIZAPTAfht/zDLb7Hwgu2twsS1Ra9w/yyvtlwIZANET
|
||||
26votwJAHK1yUrZGA5nnp5qcmQ/JUQIZAII5YV/UUZvF9D/fUplJ7puENPWNY9bN
|
||||
pQIZAMMwxuS3XiO7two2sQF6W+JTYyX1DPCwAQIZAOYg1TvEGT38k8e8jygv8E8w
|
||||
YqrWTeQFNQ==
|
||||
-----END RSA PRIVATE KEY-----`;
|
||||
|
||||
var ca = [ cert, cacert ];
|
||||
|
||||
|
@ -4,8 +4,8 @@ require('../common');
|
||||
const assert = require('assert');
|
||||
const tls = require('tls');
|
||||
|
||||
const singles = 'C=US\nST=CA\nL=SF\nO=Node.js Foundation\nOU=Node.js\nCN=ca1\n'
|
||||
+ 'emailAddress=ry@clouds.org';
|
||||
const singles = 'C=US\nST=CA\nL=SF\nO=Node.js Foundation\nOU=Node.js\n' +
|
||||
'CN=ca1\nemailAddress=ry@clouds.org';
|
||||
const singlesOut = tls.parseCertString(singles);
|
||||
assert.deepEqual(singlesOut, {
|
||||
C: 'US',
|
||||
|
@ -5,27 +5,32 @@ require('../common');
|
||||
var assert = require('assert');
|
||||
var zlib = require('zlib');
|
||||
|
||||
var inputString = 'ΩΩLorem ipsum dolor sit amet, consectetur adipiscing el' +
|
||||
'it. Morbi faucibus, purus at gravida dictum, libero arcu convallis la' +
|
||||
'cus, in commodo libero metus eu nisi. Nullam commodo, neque nec porta' +
|
||||
' placerat, nisi est fermentum augue, vitae gravida tellus sapien sit ' +
|
||||
'amet tellus. Aenean non diam orci. Proin quis elit turpis. Suspendiss' +
|
||||
'e non diam ipsum. Suspendisse nec ullamcorper odio. Vestibulum arcu m' +
|
||||
'i, sodales non suscipit id, ultrices ut massa. Sed ac sem sit amet ar' +
|
||||
'cu malesuada fermentum. Nunc sed. ';
|
||||
var expectedBase64Deflate = 'eJxdUUtOQzEMvMoc4OndgT0gJCT2buJWlpI4jePeqZfpm' +
|
||||
'XAKLRKbLOzx/HK73q6vOrhCunlF1qIDJhNUeW5I2ozT5OkDlKWLJWkncJG5403HQXAkT3' +
|
||||
'Jw29B9uIEmToMukglZ0vS6ociBh4JG8sV4oVLEUCitK2kxq1WzPnChHDzsaGKy491Lofo' +
|
||||
'AbWh8do43oeuYhB5EPCjcLjzYJo48KrfQBvnJecNFJvHT1+RSQsGoC7dn2t/xjhduTA1N' +
|
||||
'WyQIZR0pbHwMDatnD+crPqKSqGPHp1vnlsWM/07ubf7bheF7kqSj84Bm0R1fYTfaK8vqq' +
|
||||
'qfKBtNMhe3OZh6N95CTvMX5HJJi4xOVzCgUOIMSLH7wmeOHaFE4RdpnGavKtrB5xzfO/Ll9';
|
||||
var expectedBase64Gzip = 'H4sIAAAAAAAAA11RS05DMQy8yhzg6d2BPSAkJPZu4laWkjiN' +
|
||||
'496pl+mZcAotEpss7PH8crverq86uEK6eUXWogMmE1R5bkjajNPk6QOUpYslaSdwkbnjT' +
|
||||
'cdBcCRPcnDb0H24gSZOgy6SCVnS9LqhyIGHgkbyxXihUsRQKK0raTGrVbM+cKEcPOxoYr' +
|
||||
'Lj3Uuh+gBtaHx2jjeh65iEHkQ8KNwuPNgmjjwqt9AG+cl5w0Um8dPX5FJCwagLt2fa3/G' +
|
||||
'OF25MDU1bJAhlHSlsfAwNq2cP5ys+opKoY8enW+eWxYz/Tu5t/tuF4XuSpKPzgGbRHV9h' +
|
||||
'N9ory+qqp8oG00yF7c5mHo33kJO8xfkckmLjE5XMKBQ4gxIsfvCZ44doUThF2mcZq8q2s' +
|
||||
'HnHNzRtagj5AQAA';
|
||||
var inputString = 'ΩΩLorem ipsum dolor sit amet, consectetur adipiscing elit.' +
|
||||
' Morbi faucibus, purus at gravida dictum, libero arcu conv' +
|
||||
'allis lacus, in commodo libero metus eu nisi. Nullam commo' +
|
||||
'do, neque nec porta placerat, nisi est fermentum augue, vi' +
|
||||
'tae gravida tellus sapien sit amet tellus. Aenean non diam' +
|
||||
' orci. Proin quis elit turpis. Suspendisse non diam ipsum.' +
|
||||
' Suspendisse nec ullamcorper odio. Vestibulum arcu mi, sod' +
|
||||
'ales non suscipit id, ultrices ut massa. Sed ac sem sit am' +
|
||||
'et arcu malesuada fermentum. Nunc sed. ';
|
||||
var expectedBase64Deflate = 'eJxdUUtOQzEMvMoc4OndgT0gJCT2buJWlpI4jePeqZfpmXAK' +
|
||||
'LRKbLOzx/HK73q6vOrhCunlF1qIDJhNUeW5I2ozT5OkDlKWL' +
|
||||
'JWkncJG5403HQXAkT3Jw29B9uIEmToMukglZ0vS6ociBh4JG' +
|
||||
'8sV4oVLEUCitK2kxq1WzPnChHDzsaGKy491LofoAbWh8do43' +
|
||||
'oeuYhB5EPCjcLjzYJo48KrfQBvnJecNFJvHT1+RSQsGoC7dn' +
|
||||
'2t/xjhduTA1NWyQIZR0pbHwMDatnD+crPqKSqGPHp1vnlsWM' +
|
||||
'/07ubf7bheF7kqSj84Bm0R1fYTfaK8vqqqfKBtNMhe3OZh6N' +
|
||||
'95CTvMX5HJJi4xOVzCgUOIMSLH7wmeOHaFE4RdpnGavKtrB5' +
|
||||
'xzfO/Ll9';
|
||||
var expectedBase64Gzip = 'H4sIAAAAAAAAA11RS05DMQy8yhzg6d2BPSAkJPZu4laWkjiN496' +
|
||||
'pl+mZcAotEpss7PH8crverq86uEK6eUXWogMmE1R5bkjajNPk6Q' +
|
||||
'OUpYslaSdwkbnjTcdBcCRPcnDb0H24gSZOgy6SCVnS9LqhyIGHg' +
|
||||
'kbyxXihUsRQKK0raTGrVbM+cKEcPOxoYrLj3Uuh+gBtaHx2jjeh' +
|
||||
'65iEHkQ8KNwuPNgmjjwqt9AG+cl5w0Um8dPX5FJCwagLt2fa3/G' +
|
||||
'OF25MDU1bJAhlHSlsfAwNq2cP5ys+opKoY8enW+eWxYz/Tu5t/t' +
|
||||
'uF4XuSpKPzgGbRHV9hN9ory+qqp8oG00yF7c5mHo33kJO8xfkck' +
|
||||
'mLjE5XMKBQ4gxIsfvCZ44doUThF2mcZq8q2sHnHNzRtagj5AQAA';
|
||||
|
||||
zlib.deflate(inputString, function(err, buffer) {
|
||||
assert.equal(buffer.toString('base64'), expectedBase64Deflate,
|
||||
|
@ -5,14 +5,15 @@ require('../common');
|
||||
const assert = require('assert');
|
||||
const zlib = require ('zlib');
|
||||
|
||||
const inputString = 'ΩΩLorem ipsum dolor sit amet, consectetur adipiscing el' +
|
||||
'it. Morbi faucibus, purus at gravida dictum, libero arcu convallis la' +
|
||||
'cus, in commodo libero metus eu nisi. Nullam commodo, neque nec porta' +
|
||||
' placerat, nisi est fermentum augue, vitae gravida tellus sapien sit ' +
|
||||
'amet tellus. Aenean non diam orci. Proin quis elit turpis. Suspendiss' +
|
||||
'e non diam ipsum. Suspendisse nec ullamcorper odio. Vestibulum arcu m' +
|
||||
'i, sodales non suscipit id, ultrices ut massa. Sed ac sem sit amet ar' +
|
||||
'cu malesuada fermentum. Nunc sed. ';
|
||||
const inputString = 'ΩΩLorem ipsum dolor sit amet, consectetur adipiscing eli' +
|
||||
't. Morbi faucibus, purus at gravida dictum, libero arcu ' +
|
||||
'convallis lacus, in commodo libero metus eu nisi. Nullam' +
|
||||
' commodo, neque nec porta placerat, nisi est fermentum a' +
|
||||
'ugue, vitae gravida tellus sapien sit amet tellus. Aenea' +
|
||||
'n non diam orci. Proin quis elit turpis. Suspendisse non' +
|
||||
' diam ipsum. Suspendisse nec ullamcorper odio. Vestibulu' +
|
||||
'm arcu mi, sodales non suscipit id, ultrices ut massa. S' +
|
||||
'ed ac sem sit amet arcu malesuada fermentum. Nunc sed. ';
|
||||
|
||||
[
|
||||
{ comp: 'gzip', decomp: 'gunzip', decompSync: 'gunzipSync' },
|
||||
|
Loading…
x
Reference in New Issue
Block a user