Skip to content

Commit

Permalink
test: favor strict equality in pummel net tests
Browse files Browse the repository at this point in the history
Favor strict equality checks over loose equality checks in
pummel/test-net-* tests.

PR-URL: #8135
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott authored and MylesBorins committed Oct 26, 2016
1 parent ac83d19 commit e3669f8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/pummel/test-net-connect-econnrefused.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function pummel() {
net.createConnection(common.PORT).on('error', function(err) {
assert.equal(err.code, 'ECONNREFUSED');
if (--pending > 0) return;
if (rounds == ROUNDS) return check();
if (rounds === ROUNDS) return check();
rounds++;
pummel();
});
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-net-connect-memleak.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var before = 0;
before = process.memoryUsage().rss;

net.createConnection(common.PORT, '127.0.0.1', function() {
assert(junk.length != 0); // keep reference alive
assert.notStrictEqual(junk.length, 0); // keep reference alive
setTimeout(done, 10);
gc();
});
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-net-many-clients.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ server.listen(common.PORT, function() {
var finished_clients = 0;
for (var i = 0; i < concurrency; i++) {
runClient(function() {
if (++finished_clients == concurrency) server.close();
if (++finished_clients === concurrency) server.close();
});
}
});
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-net-timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ echo_server.listen(common.PORT, function() {
client.write('hello\r\n');
}, 500);

if (exchanges == 5) {
if (exchanges === 5) {
console.log('wait for timeout - should come in ' + timeout + ' ms');
starttime = new Date();
console.dir(starttime);
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-net-timeout2.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var server = net.createServer(function(socket) {
var interval = setInterval(function() {
counter++;

if (counter == seconds) {
if (counter === seconds) {
clearInterval(interval);
server.close();
socket.destroy();
Expand Down

0 comments on commit e3669f8

Please sign in to comment.