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>
process-exit-stdio-flushing
Rich Trott 9 years ago
parent
commit
0351b2f1b4
  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) {
switch (connected % 6) {
case 0:
child1.send('end', socket, { track: false }); break;
child1.send('end', socket); break;
case 1:
child1.send('write', socket, { track: true }); break;
child1.send('write', socket); break;
case 2:
child2.send('end', socket, { track: true }); break;
child2.send('end', socket); break;
case 3:
child2.send('write', socket, { track: false }); break;
child2.send('write', socket); break;
case 4:
child3.send('end', socket, { track: false }); break;
child3.send('end', socket); break;
case 5:
child3.send('write', socket, { track: false }); break;
child3.send('write', socket); break;
}
connected += 1;

Loading…
Cancel
Save