Skip to content

Commit

Permalink
test: swap expected and actual arguments in assert.strictEqual()
Browse files Browse the repository at this point in the history
PR-URL: #23542
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
erin-bush authored and jasnell committed Oct 17, 2018
1 parent 33351a1 commit ea90776
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/pummel/test-net-pingpong-delay.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ function pingPongTest(port, host, on_complete) {

socket.on('data', function(data) {
console.log(data);
assert.strictEqual('PING', data);
assert.strictEqual('open', socket.readyState);
assert.strictEqual(true, count <= N);
assert.strictEqual(data, 'PING');
assert.strictEqual(socket.readyState, 'open');
assert.strictEqual(count <= N, true);
setTimeout(function() {
assert.strictEqual('open', socket.readyState);
assert.strictEqual(socket.readyState, 'open');
socket.write('PONG');
}, DELAY);
});
Expand All @@ -51,14 +51,14 @@ function pingPongTest(port, host, on_complete) {

socket.on('end', function() {
console.log('server-side socket EOF');
assert.strictEqual('writeOnly', socket.readyState);
assert.strictEqual(socket.readyState, 'writeOnly');
socket.end();
});

socket.on('close', function(had_error) {
console.log('server-side socket.end');
assert.strictEqual(false, had_error);
assert.strictEqual('closed', socket.readyState);
assert.strictEqual(had_error, false);
assert.strictEqual(socket.readyState, 'closed');
socket.server.close();
});
});
Expand All @@ -69,17 +69,17 @@ function pingPongTest(port, host, on_complete) {
client.setEncoding('utf8');

client.on('connect', function() {
assert.strictEqual('open', client.readyState);
assert.strictEqual(client.readyState, 'open');
client.write('PING');
});

client.on('data', function(data) {
console.log(data);
assert.strictEqual('PONG', data);
assert.strictEqual('open', client.readyState);
assert.strictEqual(data, 'PONG');
assert.strictEqual(client.readyState, 'open');

setTimeout(function() {
assert.strictEqual('open', client.readyState);
assert.strictEqual(client.readyState, 'open');
if (count++ < N) {
client.write('PING');
} else {
Expand All @@ -97,7 +97,7 @@ function pingPongTest(port, host, on_complete) {

client.on('close', common.mustCall(function() {
console.log('client.end');
assert.strictEqual(N + 1, count);
assert.strictEqual(count, N + 1);
assert.ok(client_ended);
if (on_complete) on_complete();
}));
Expand Down

0 comments on commit ea90776

Please sign in to comment.