Skip to content

Commit 37f3642

Browse files
TrottMylesBorins
authored andcommitted
test: use consistent block spacing
In preparation for enabling an ESLint rule, use consistent block spacing. This changes only six files in the code base as block spacing is consistent throughout the rest of the code base. Before: function(c) {data += c;} After: function(c) { data += c; } PR-URL: #10377 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Julian Duque <[email protected]>
1 parent 8f2ce6c commit 37f3642

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

test/parallel/test-assert.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ try {
358358
assert.equal(true, threw,
359359
'a.doesNotThrow is not catching type matching errors');
360360

361-
assert.throws(function() {assert.ifError(new Error('test error'));});
362-
assert.doesNotThrow(function() {assert.ifError(null);});
363-
assert.doesNotThrow(function() {assert.ifError();});
361+
assert.throws(function() { assert.ifError(new Error('test error')); });
362+
assert.doesNotThrow(function() { assert.ifError(null); });
363+
assert.doesNotThrow(function() { assert.ifError(); });
364364

365365
assert.throws(() => {
366366
assert.doesNotThrow(makeBlock(thrower, Error), 'user message');

test/parallel/test-buffer-alloc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ assert.throws(() => Buffer.from('', 'buffer'), TypeError);
10201020
{
10211021
let a = [0];
10221022
for (let i = 0; i < 7; ++i) a = a.concat(a);
1023-
a = a.map((_, i) => {return i;});
1023+
a = a.map((_, i) => { return i; });
10241024
const b = Buffer.from(a);
10251025
const c = Buffer.from(b);
10261026
assert.strictEqual(b.length, a.length);

test/parallel/test-debugger-repeat-last.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ var sentExit = false;
2626
proc.stdout.on('data', (data) => {
2727
stdout += data;
2828
if (!sentCommand && stdout.includes('> 1')) {
29-
setImmediate(() => {proc.stdin.write('n\n');});
29+
setImmediate(() => { proc.stdin.write('n\n'); });
3030
return sentCommand = true;
3131
}
3232
if (!sentEmpty && stdout.includes('> 3')) {
33-
setImmediate(() => {proc.stdin.write('\n');});
33+
setImmediate(() => { proc.stdin.write('\n'); });
3434
return sentEmpty = true;
3535
}
3636
if (!sentExit && sentCommand && sentEmpty) {
37-
setTimeout(() => {proc.stdin.write('\n\n\n.exit\n\n\n');}, 1);
37+
setTimeout(() => { proc.stdin.write('\n\n\n.exit\n\n\n'); }, 1);
3838
return sentExit = true;
3939
}
4040
});

test/parallel/test-fs-realpath.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function test_simple_relative_symlink(callback) {
8787
[
8888
[entry, '../' + common.tmpDirName + '/cycles/root.js']
8989
].forEach(function(t) {
90-
try {fs.unlinkSync(t[0]);} catch (e) {}
90+
try { fs.unlinkSync(t[0]); } catch (e) {}
9191
console.log('fs.symlinkSync(%j, %j, %j)', t[1], t[0], 'file');
9292
fs.symlinkSync(t[1], t[0], 'file');
9393
unlink.push(t[0]);
@@ -113,7 +113,7 @@ function test_simple_absolute_symlink(callback) {
113113
[
114114
[entry, expected]
115115
].forEach(function(t) {
116-
try {fs.unlinkSync(t[0]);} catch (e) {}
116+
try { fs.unlinkSync(t[0]); } catch (e) {}
117117
console.error('fs.symlinkSync(%j, %j, %j)', t[1], t[0], type);
118118
fs.symlinkSync(t[1], t[0], type);
119119
unlink.push(t[0]);
@@ -138,13 +138,13 @@ function test_deep_relative_file_symlink(callback) {
138138
expected);
139139
const linkPath1 = path.join(targetsAbsDir,
140140
'nested-index', 'one', 'symlink1.js');
141-
try {fs.unlinkSync(linkPath1);} catch (e) {}
141+
try { fs.unlinkSync(linkPath1); } catch (e) {}
142142
fs.symlinkSync(linkData1, linkPath1, 'file');
143143

144144
const linkData2 = '../one/symlink1.js';
145145
const entry = path.join(targetsAbsDir,
146146
'nested-index', 'two', 'symlink1-b.js');
147-
try {fs.unlinkSync(entry);} catch (e) {}
147+
try { fs.unlinkSync(entry); } catch (e) {}
148148
fs.symlinkSync(linkData2, entry, 'file');
149149
unlink.push(linkPath1);
150150
unlink.push(entry);
@@ -165,13 +165,13 @@ function test_deep_relative_dir_symlink(callback) {
165165
const path1b = path.join(targetsAbsDir, 'nested-index', 'one');
166166
const linkPath1b = path.join(path1b, 'symlink1-dir');
167167
const linkData1b = path.relative(path1b, expected);
168-
try {fs.unlinkSync(linkPath1b);} catch (e) {}
168+
try { fs.unlinkSync(linkPath1b); } catch (e) {}
169169
fs.symlinkSync(linkData1b, linkPath1b, 'dir');
170170

171171
const linkData2b = '../one/symlink1-dir';
172172
const entry = path.join(targetsAbsDir,
173173
'nested-index', 'two', 'symlink12-dir');
174-
try {fs.unlinkSync(entry);} catch (e) {}
174+
try { fs.unlinkSync(entry); } catch (e) {}
175175
fs.symlinkSync(linkData2b, entry, 'dir');
176176
unlink.push(linkPath1b);
177177
unlink.push(entry);
@@ -195,7 +195,7 @@ function test_cyclic_link_protection(callback) {
195195
[common.tmpDir + '/cycles/realpath-3b', '../cycles/realpath-3c'],
196196
[common.tmpDir + '/cycles/realpath-3c', '../cycles/realpath-3a']
197197
].forEach(function(t) {
198-
try {fs.unlinkSync(t[0]);} catch (e) {}
198+
try { fs.unlinkSync(t[0]); } catch (e) {}
199199
fs.symlinkSync(t[1], t[0], 'dir');
200200
unlink.push(t[0]);
201201
});
@@ -218,7 +218,7 @@ function test_cyclic_link_overprotection(callback) {
218218
const link = folder + '/cycles';
219219
var testPath = cycles;
220220
testPath += '/folder/cycles'.repeat(10);
221-
try {fs.unlinkSync(link);} catch (ex) {}
221+
try { fs.unlinkSync(link); } catch (ex) {}
222222
fs.symlinkSync(cycles, link, 'dir');
223223
unlink.push(link);
224224
assertEqualPath(fs.realpathSync(testPath), path.resolve(expected));
@@ -246,7 +246,7 @@ function test_relative_input_cwd(callback) {
246246
].forEach(function(t) {
247247
const fn = t[0];
248248
console.error('fn=%j', fn);
249-
try {fs.unlinkSync(fn);} catch (e) {}
249+
try { fs.unlinkSync(fn); } catch (e) {}
250250
const b = path.basename(t[1]);
251251
const type = (b === 'root.js' ? 'file' : 'dir');
252252
console.log('fs.symlinkSync(%j, %j, %j)', t[1], fn, type);
@@ -363,7 +363,7 @@ function test_up_multiple(cb) {
363363
['a/b',
364364
'a'
365365
].forEach(function(folder) {
366-
try {fs.rmdirSync(tmp(folder));} catch (ex) {}
366+
try { fs.rmdirSync(tmp(folder)); } catch (ex) {}
367367
});
368368
}
369369
function setup() {
@@ -420,14 +420,14 @@ function test_abs_with_kids(cb) {
420420
['/a/b/c/x.txt',
421421
'/a/link'
422422
].forEach(function(file) {
423-
try {fs.unlinkSync(root + file);} catch (ex) {}
423+
try { fs.unlinkSync(root + file); } catch (ex) {}
424424
});
425425
['/a/b/c',
426426
'/a/b',
427427
'/a',
428428
''
429429
].forEach(function(folder) {
430-
try {fs.rmdirSync(root + folder);} catch (ex) {}
430+
try { fs.rmdirSync(root + folder); } catch (ex) {}
431431
});
432432
}
433433
function setup() {

test/parallel/test-http-chunked.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ server.listen(0, function() {
2525
port: this.address().port
2626
}, function(x) {
2727
x.setEncoding('utf8');
28-
x.on('data', function(c) {data += c;});
28+
x.on('data', function(c) { data += c; });
2929
x.on('error', function(e) {
3030
throw e;
3131
});
@@ -37,7 +37,7 @@ server.listen(0, function() {
3737
server.close();
3838
});
3939
});
40-
get.on('error', function(e) {throw e;});
40+
get.on('error', function(e) { throw e; });
4141
get.end();
4242

4343
});

test/parallel/test-v8-flag-type-check.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ require('../common');
33
var assert = require('assert');
44
var v8 = require('v8');
55

6-
assert.throws(function() {v8.setFlagsFromString(1);}, TypeError);
7-
assert.throws(function() {v8.setFlagsFromString();}, TypeError);
6+
assert.throws(function() { v8.setFlagsFromString(1); }, TypeError);
7+
assert.throws(function() { v8.setFlagsFromString(); }, TypeError);

0 commit comments

Comments
 (0)