Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: apply manual formatting to previous commits
  • Loading branch information
tniessen committed Oct 13, 2020
commit 4b8676e16ef692e1fd5cbb7bf6f359fba7918567
6 changes: 3 additions & 3 deletions test/internet/test-dns-any.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ TEST(async function test_sip2sip_for_naptr(done) {
const req = dns.resolve(
'sip2sip.info',
'ANY',
common.mustSucceed(function(ret) {
common.mustSucceed((ret) => {
validateResult(ret);
done();
}));
Expand All @@ -146,7 +146,7 @@ TEST(async function test_google_for_cname_and_srv(done) {
const req = dns.resolve(
'_jabber._tcp.google.com',
'ANY',
common.mustSucceed(function(ret) {
common.mustSucceed((ret) => {
validateResult(ret);
done();
}));
Expand All @@ -165,7 +165,7 @@ TEST(async function test_ptr(done) {
const req = dns.resolve(
'8.8.8.8.in-addr.arpa',
'ANY',
common.mustSucceed(function(ret) {
common.mustSucceed((ret) => {
validateResult(ret);
done();
}));
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-c-ares.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ dns.lookup('::1', common.mustSucceed((result, addressType) => {
// so we disable this test on Windows.
// IBMi reports `ENOTFOUND` when get hostname by address 127.0.0.1
if (!common.isWindows && !common.isIBMi) {
dns.reverse('127.0.0.1', common.mustSucceed(function(domains) {
dns.reverse('127.0.0.1', common.mustSucceed((domains) => {
assert.ok(Array.isArray(domains));
}));

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-child-process-exec-cwd.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ if (common.isWindows) {
dir = '/dev';
}

exec(pwdcommand, { cwd: dir }, common.mustSucceed(function(stdout, stderr) {
exec(pwdcommand, { cwd: dir }, common.mustSucceed((stdout, stderr) => {
assert(stdout.startsWith(dir));
}));
16 changes: 0 additions & 16 deletions test/parallel/test-crypto-keygen.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
format: 'pem'
}
}, common.mustSucceed((publicKeyDER, privateKey) => {

assert(Buffer.isBuffer(publicKeyDER));
assertApproximateSize(publicKeyDER, 74);

Expand All @@ -169,7 +168,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
passphrase: 'secret'
}
}, common.mustSucceed((publicKeyDER, privateKey) => {

assert(Buffer.isBuffer(publicKeyDER));
assertApproximateSize(publicKeyDER, 74);

Expand Down Expand Up @@ -201,7 +199,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
passphrase: 'secret'
}
}, common.mustSucceed((publicKeyDER, privateKeyDER) => {

assert(Buffer.isBuffer(publicKeyDER));
assertApproximateSize(publicKeyDER, 74);

Expand Down Expand Up @@ -243,7 +240,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
format: 'der'
}
}, common.mustSucceed((publicKeyDER, privateKeyDER) => {

assert(Buffer.isBuffer(publicKeyDER));
assertApproximateSize(publicKeyDER, 74);

Expand All @@ -269,7 +265,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
hash: 'sha256',
mgf1Hash: 'sha256'
}, common.mustSucceed((publicKey, privateKey) => {

assert.strictEqual(publicKey.type, 'public');
assert.strictEqual(publicKey.asymmetricKeyType, 'rsa-pss');

Expand Down Expand Up @@ -317,7 +312,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
...privateKeyEncoding
}
}, common.mustSucceed((publicKey, privateKeyDER) => {

assert.strictEqual(typeof publicKey, 'string');
assert(spkiExp.test(publicKey));
// The private key is DER-encoded.
Expand Down Expand Up @@ -362,7 +356,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
format: 'pem'
}
}, common.mustSucceed((publicKey, privateKey) => {

assert.strictEqual(typeof publicKey, 'string');
assert(spkiExp.test(publicKey));
assert.strictEqual(typeof privateKey, 'string');
Expand All @@ -385,7 +378,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
format: 'pem'
}
}, common.mustSucceed((publicKey, privateKey) => {

assert.strictEqual(typeof publicKey, 'string');
assert(spkiExp.test(publicKey));
assert.strictEqual(typeof privateKey, 'string');
Expand All @@ -409,7 +401,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
passphrase: 'secret'
}
}, common.mustSucceed((publicKey, privateKey) => {

assert.strictEqual(typeof publicKey, 'string');
assert(spkiExp.test(publicKey));
assert.strictEqual(typeof privateKey, 'string');
Expand Down Expand Up @@ -440,7 +431,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
passphrase: 'secret'
}
}, common.mustSucceed((publicKey, privateKey) => {

assert.strictEqual(typeof publicKey, 'string');
assert(spkiExp.test(publicKey));
assert.strictEqual(typeof privateKey, 'string');
Expand Down Expand Up @@ -474,7 +464,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
passphrase: 'top secret'
}
}, common.mustSucceed((publicKey, privateKey) => {

assert.strictEqual(typeof publicKey, 'string');
assert(spkiExp.test(publicKey));
assert.strictEqual(typeof privateKey, 'string');
Expand Down Expand Up @@ -509,7 +498,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
passphrase: 'top secret'
}
}, common.mustSucceed((publicKey, privateKey) => {

assert.strictEqual(typeof publicKey, 'string');
assert(spkiExp.test(publicKey));
assert.strictEqual(typeof privateKey, 'string');
Expand Down Expand Up @@ -626,7 +614,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
format: 'pem'
}
}, common.mustSucceed((publicKey, privateKey) => {

assert.strictEqual(typeof publicKey, 'object');
assert.strictEqual(publicKey.type, 'public');
assert.strictEqual(publicKey.asymmetricKeyType, 'rsa');
Expand All @@ -646,7 +633,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
format: 'pem'
}
}, common.mustSucceed((publicKey, privateKey) => {

// The public key should still be a string.
assert.strictEqual(typeof publicKey, 'string');

Expand Down Expand Up @@ -956,7 +942,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
if (!/^1\.1\.0/.test(process.versions.openssl)) {
['ed25519', 'ed448', 'x25519', 'x448'].forEach((keyType) => {
generateKeyPair(keyType, common.mustSucceed((publicKey, privateKey) => {

assert.strictEqual(publicKey.type, 'public');
assert.strictEqual(publicKey.asymmetricKeyType, keyType);

Expand All @@ -972,7 +957,6 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
generateKeyPair('dh', {
primeLength: 1024
}, common.mustSucceed((publicKey, privateKey) => {

assert.strictEqual(publicKey.type, 'public');
assert.strictEqual(publicKey.asymmetricKeyType, 'dh');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-dgram-connect-send-callback-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const client = dgram.createSocket('udp4');

const buf = Buffer.allocUnsafe(256);

const onMessage = common.mustSucceed(function(bytes) {
const onMessage = common.mustSucceed((bytes) => {
assert.strictEqual(bytes, buf.length);
client.close();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const client = dgram.createSocket('udp4');

const buf = Buffer.alloc(256, 'x');

const onMessage = common.mustSucceed(function(bytes) {
const onMessage = common.mustSucceed((bytes) => {
assert.strictEqual(bytes, buf.length);
client.close();
});
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-dgram-send-callback-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const client = dgram.createSocket('udp4');

const buf = Buffer.allocUnsafe(256);

const onMessage = common.mustSucceed(function(bytes) {
const onMessage = common.mustSucceed((bytes) => {
assert.strictEqual(bytes, buf.length);
client.close();
});
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-fs-chmod-mask.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ function test(mode, asString) {
const file = path.join(tmpdir.path, `fchmod-async-${suffix}.txt`);
fs.writeFileSync(file, 'test', 'utf-8');
fs.open(file, 'w', common.mustSucceed((fd) => {

fs.fchmod(fd, input, common.mustSucceed(() => {
assert.strictEqual(fs.fstatSync(fd).mode & 0o777, mode);
fs.close(fd, assert.ifError);
Expand Down
4 changes: 0 additions & 4 deletions test/parallel/test-fs-chmod.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ const file2 = path.join(tmpdir.path, 'a1.js');
fs.closeSync(fs.openSync(file1, 'w'));

fs.chmod(file1, mode_async.toString(8), common.mustSucceed(() => {

if (common.isWindows) {
assert.ok((fs.statSync(file1).mode & 0o777) & mode_async);
} else {
Expand All @@ -97,9 +96,7 @@ fs.chmod(file1, mode_async.toString(8), common.mustSucceed(() => {
}));

fs.open(file2, 'w', common.mustSucceed((fd) => {

fs.fchmod(fd, mode_async.toString(8), common.mustSucceed(() => {

if (common.isWindows) {
assert.ok((fs.fstatSync(fd).mode & 0o777) & mode_async);
} else {
Expand Down Expand Up @@ -134,7 +131,6 @@ if (fs.lchmod) {
fs.symlinkSync(file2, link);

fs.lchmod(link, mode_async, common.mustSucceed(() => {

assert.strictEqual(fs.lstatSync(link).mode & 0o777, mode_async);

fs.lchmodSync(link, mode_sync);
Expand Down
2 changes: 0 additions & 2 deletions test/parallel/test-fs-empty-readStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const fixtures = require('../common/fixtures');
const emptyFile = fixtures.path('empty.txt');

fs.open(emptyFile, 'r', common.mustSucceed((fd) => {

const read = fs.createReadStream(emptyFile, { fd });

read.once('data', common.mustNotCall('data event should not emit'));
Expand All @@ -37,7 +36,6 @@ fs.open(emptyFile, 'r', common.mustSucceed((fd) => {
}));

fs.open(emptyFile, 'r', common.mustSucceed((fd) => {

const read = fs.createReadStream(emptyFile, { fd });

read.pause();
Expand Down
7 changes: 3 additions & 4 deletions test/parallel/test-fs-fsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ const fileTemp = path.join(tmpdir.path, 'a.js');
tmpdir.refresh();
fs.copyFileSync(fileFixture, fileTemp);

fs.open(fileTemp, 'a', 0o777, common.mustSucceed(function(fd) {

fs.open(fileTemp, 'a', 0o777, common.mustSucceed((fd) => {
fs.fdatasyncSync(fd);

fs.fsyncSync(fd);

fs.fdatasync(fd, common.mustSucceed(function() {
fs.fsync(fd, common.mustSucceed(function() {
fs.fdatasync(fd, common.mustSucceed(() => {
fs.fsync(fd, common.mustSucceed(() => {
fs.closeSync(fd);
}));
}));
Expand Down
6 changes: 2 additions & 4 deletions test/parallel/test-fs-long-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ console.log({
fullPathLength: fullPath.length
});

fs.writeFile(fullPath, 'ok', common.mustSucceed(function() {

fs.stat(fullPath, common.mustSucceed(function(stats) {
}));
fs.writeFile(fullPath, 'ok', common.mustSucceed(() => {
fs.stat(fullPath, common.mustSucceed());
}));
3 changes: 1 addition & 2 deletions test/parallel/test-fs-mkdir-rmdir.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ fs.rmdirSync(d);
assert(!fs.existsSync(d));

// Similarly test the Async version
fs.mkdir(d, 0o666, common.mustSucceed(function() {

fs.mkdir(d, 0o666, common.mustSucceed(() => {
fs.mkdir(d, 0o666, common.mustCall(function(err) {
assert.strictEqual(this, undefined);
assert.ok(err, 'got no error');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-opendir.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const invalidCallbackObj = {
}

// Check the opendir async version
fs.opendir(testDir, common.mustSucceed(function(dir) {
fs.opendir(testDir, common.mustSucceed((dir) => {
let sync = true;
dir.read(common.mustCall((err, dirent) => {
assert(!sync);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-readdir.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ files.forEach(function(currentFile) {
assert.deepStrictEqual(files, fs.readdirSync(readdirDir).sort());

// Check the readdir async version
fs.readdir(readdirDir, common.mustSucceed(function(f) {
fs.readdir(readdirDir, common.mustSucceed((f) => {
assert.deepStrictEqual(files, f.sort());
}));

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-readfile-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const exec = require('child_process').exec;
const f = JSON.stringify(__filename);
const node = JSON.stringify(process.execPath);
const cmd = `cat ${filename} | ${node} ${f} child`;
exec(cmd, common.mustSucceed(function(stdout, stderr) {
exec(cmd, common.mustSucceed((stdout, stderr) => {
assert.strictEqual(
stdout,
dataExpected,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-readfilesync-enoent.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function test(p) {
const result = fs.realpathSync(p);
assert.strictEqual(result.toLowerCase(), path.resolve(p).toLowerCase());

fs.realpath(p, common.mustSucceed(function(result) {
fs.realpath(p, common.mustSucceed((result) => {
assert.strictEqual(result.toLowerCase(), path.resolve(p).toLowerCase());
}));
}
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-readfilesync-pipe-large.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const cmd = `cat ${filename} | ${node} ${f} child`;
exec(
cmd,
{ maxBuffer: 1000000 },
common.mustSucceed(function(stdout, stderr) {
common.mustSucceed((stdout, stderr) => {
assert.strictEqual(stdout, dataExpected);
assert.strictEqual(stderr, '');
console.log('ok');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-fs-readv.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const allocateEmptyBuffers = (combinedLength) => {

const getCallback = (fd, bufferArr) => {
return common.mustSucceed((bytesRead, buffers) => {

assert.deepStrictEqual(bufferArr, buffers);
const expectedLength = exptectedBuff.length;
assert.deepStrictEqual(bytesRead, expectedLength);
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-fs-realpath-on-substed-drive.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ result = fs.realpathSync(filename, 'buffer');
assert(Buffer.isBuffer(result));
assert(result.equals(filenameBuffer));

fs.realpath(filename, common.mustSucceed(function(result) {
fs.realpath(filename, common.mustSucceed((result) => {
assert.strictEqual(result, filename);
}));

fs.realpath(filename, 'buffer', common.mustSucceed(function(result) {
fs.realpath(filename, 'buffer', common.mustSucceed((result) => {
assert(Buffer.isBuffer(result));
assert(result.equals(filenameBuffer));
}));
2 changes: 0 additions & 2 deletions test/parallel/test-fs-rmdir-recursive.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ function removeAsync(dir) {

// Recursive removal should succeed.
fs.rmdir(dir, { recursive: true }, common.mustSucceed(() => {

// No error should occur if recursive and the directory does not exist.
fs.rmdir(dir, { recursive: true }, common.mustSucceed(() => {

// Attempted removal should fail now because the directory is gone.
fs.rmdir(dir, common.mustCall((err) => {
assert.strictEqual(err.syscall, 'rmdir');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fs.open('.', 'r', undefined, common.mustCall(function(err, fd) {
fs.close(fd, common.mustSucceed());
}));

fs.stat(__filename, common.mustSucceed(function(s) {
fs.stat(__filename, common.mustSucceed((s) => {
assert.strictEqual(s.isDirectory(), false);
assert.strictEqual(s.isFile(), true);
assert.strictEqual(s.isSocket(), false);
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-fs-symlink-buffer-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ let fileTime;
// Refs: https://github.com/nodejs/node/issues/34514
fs.symlinkSync(Buffer.from(linkData), linkPath);

fs.lstat(linkPath, common.mustSucceed(function(stats) {
fs.lstat(linkPath, common.mustSucceed((stats) => {
linkTime = stats.mtime.getTime();
}));

fs.stat(linkPath, common.mustSucceed(function(stats) {
fs.stat(linkPath, common.mustSucceed((stats) => {
fileTime = stats.mtime.getTime();
}));

fs.readlink(linkPath, common.mustSucceed(function(destination) {
fs.readlink(linkPath, common.mustSucceed((destination) => {
assert.strictEqual(destination, linkData);
}));

Expand Down
Loading