Skip to content

Commit b52571c

Browse files
TrottMylesBorins
authored andcommitted
test: implement consistent braces
This change is in preparation for lint enforcement of brace style. PR-URL: #8348 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Myles Borins <[email protected]>
1 parent 1c921cc commit b52571c

25 files changed

+40
-76
lines changed

test/internet/test-dgram-broadcast-multi-process.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ if (process.argv[2] !== 'child') {
9494
//all child process are listening, so start sending
9595
sendSocket.sendNext();
9696
}
97-
}
98-
else if (msg.message) {
97+
} else if (msg.message) {
9998
worker.messagesReceived.push(msg.message);
10099

101100
if (worker.messagesReceived.length === messages.length) {

test/parallel/test-child-process-fork-exec-path.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ if (process.env.FORK) {
1212
assert.equal(process.argv[0], copyPath);
1313
process.send(msg);
1414
process.exit();
15-
}
16-
else {
15+
} else {
1716
common.refreshTmpDir();
1817
try {
1918
fs.unlinkSync(copyPath);
20-
}
21-
catch (e) {
19+
} catch (e) {
2220
if (e.code !== 'ENOENT') throw e;
2321
}
2422
fs.writeFileSync(copyPath, fs.readFileSync(nodePath));

test/parallel/test-child-process-recv-handle.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,12 @@ function worker() {
4949
if (n === 1) {
5050
assert.equal(msg, 'one');
5151
assert.equal(handle, undefined);
52-
}
53-
else if (n === 2) {
52+
} else if (n === 2) {
5453
assert.equal(msg, 'two');
5554
assert.equal(typeof handle, 'object'); // Also matches null, therefore...
5655
assert.ok(handle); // also check that it's truthy.
5756
handle.close();
58-
}
59-
else if (n === 3) {
57+
} else if (n === 3) {
6058
assert.equal(msg, 'three');
6159
assert.equal(handle, undefined);
6260
process.exit();

test/parallel/test-cluster-basic.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ if (cluster.isWorker) {
1818
http.Server(function() {
1919

2020
}).listen(common.PORT, '127.0.0.1');
21-
}
22-
23-
else if (cluster.isMaster) {
21+
} else if (cluster.isMaster) {
2422

2523
var checks = {
2624
cluster: {

test/parallel/test-cluster-bind-privileged-port.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ if (cluster.isMaster) {
1818
cluster.fork().on('exit', common.mustCall(function(exitCode) {
1919
assert.equal(exitCode, 0);
2020
}));
21-
}
22-
else {
21+
} else {
2322
var s = net.createServer(common.fail);
2423
s.listen(42, common.fail.bind(null, 'listen should have failed'));
2524
s.on('error', common.mustCall(function(err) {

test/parallel/test-cluster-bind-twice.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ if (!id) {
6464
process.on('exit', function() {
6565
assert(ok);
6666
});
67-
}
68-
else if (id === 'one') {
67+
} else if (id === 'one') {
6968
if (cluster.isMaster) return startWorker();
7069

7170
http.createServer(common.fail).listen(common.PORT, function() {
@@ -75,8 +74,7 @@ else if (id === 'one') {
7574
process.on('message', function(m) {
7675
if (m === 'QUIT') process.exit();
7776
});
78-
}
79-
else if (id === 'two') {
77+
} else if (id === 'two') {
8078
if (cluster.isMaster) return startWorker();
8179

8280
let ok = false;
@@ -96,8 +94,7 @@ else if (id === 'two') {
9694
ok = true;
9795
});
9896
});
99-
}
100-
else {
97+
} else {
10198
assert(0); // bad command line argument
10299
}
103100

test/parallel/test-cluster-eaddrinuse.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ if (id === 'undefined') {
2121
});
2222
});
2323
});
24-
}
25-
else if (id === 'worker') {
24+
} else if (id === 'worker') {
2625
let server = net.createServer(common.fail);
2726
server.listen(common.PORT, common.fail);
2827
server.on('error', common.mustCall(function(e) {
@@ -36,7 +35,6 @@ else if (id === 'worker') {
3635
}));
3736
});
3837
}));
39-
}
40-
else {
38+
} else {
4139
assert(0); // Bad argument.
4240
}

test/parallel/test-cluster-listening-port.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ if (cluster.isMaster) {
1919
// ensure that the 'listening' handler has been called
2020
assert(port);
2121
});
22-
}
23-
else {
22+
} else {
2423
net.createServer(common.fail).listen(0);
2524
}

test/parallel/test-cluster-message.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ if (cluster.isWorker) {
4040
});
4141

4242
server.listen(common.PORT, '127.0.0.1');
43-
}
44-
45-
else if (cluster.isMaster) {
43+
} else if (cluster.isMaster) {
4644

4745
var checks = {
4846
global: {

test/parallel/test-cluster-net-listen.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ if (cluster.isMaster) {
1414
process.on('exit', function() {
1515
assert.equal(worker, null);
1616
});
17-
}
18-
else {
17+
} else {
1918
// listen() without port should not trigger a libuv assert
2019
net.createServer(common.fail).listen(process.exit);
2120
}

0 commit comments

Comments
 (0)