Browse Source

test: refactor switch

`test-child-process-fork-net2.js` has a switch statement with 6 cases.
Each case uses `child.send()`, passing an object for the callback.
`child.send()` ignores the callback because it is not a function.
Removing the unused argument.

PR-URL: https://github.com/nodejs/node/pull/4870
Reviewed-By: Alexis Campailla <orangemocha@nodejs.org>
v5.x
Rich Trott 9 years ago
committed by Rod Vagg
parent
commit
d95e53dc3b
  1. 12
      test/parallel/test-child-process-fork-net2.js

12
test/parallel/test-child-process-fork-net2.js

@ -71,17 +71,17 @@ if (process.argv[2] === 'child') {
server.on('connection', function(socket) { server.on('connection', function(socket) {
switch (connected % 6) { switch (connected % 6) {
case 0: case 0:
child1.send('end', socket, { track: false }); break; child1.send('end', socket); break;
case 1: case 1:
child1.send('write', socket, { track: true }); break; child1.send('write', socket); break;
case 2: case 2:
child2.send('end', socket, { track: true }); break; child2.send('end', socket); break;
case 3: case 3:
child2.send('write', socket, { track: false }); break; child2.send('write', socket); break;
case 4: case 4:
child3.send('end', socket, { track: false }); break; child3.send('end', socket); break;
case 5: case 5:
child3.send('write', socket, { track: false }); break; child3.send('write', socket); break;
} }
connected += 1; connected += 1;

Loading…
Cancel
Save