Skip to content

Commit e3669f8

Browse files
TrottMylesBorins
authored andcommitted
test: favor strict equality in pummel net tests
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]>
1 parent ac83d19 commit e3669f8

5 files changed

+5
-5
lines changed

test/pummel/test-net-connect-econnrefused.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function pummel() {
1919
net.createConnection(common.PORT).on('error', function(err) {
2020
assert.equal(err.code, 'ECONNREFUSED');
2121
if (--pending > 0) return;
22-
if (rounds == ROUNDS) return check();
22+
if (rounds === ROUNDS) return check();
2323
rounds++;
2424
pummel();
2525
});

test/pummel/test-net-connect-memleak.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var before = 0;
1616
before = process.memoryUsage().rss;
1717

1818
net.createConnection(common.PORT, '127.0.0.1', function() {
19-
assert(junk.length != 0); // keep reference alive
19+
assert.notStrictEqual(junk.length, 0); // keep reference alive
2020
setTimeout(done, 10);
2121
gc();
2222
});

test/pummel/test-net-many-clients.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ server.listen(common.PORT, function() {
6969
var finished_clients = 0;
7070
for (var i = 0; i < concurrency; i++) {
7171
runClient(function() {
72-
if (++finished_clients == concurrency) server.close();
72+
if (++finished_clients === concurrency) server.close();
7373
});
7474
}
7575
});

test/pummel/test-net-timeout.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ echo_server.listen(common.PORT, function() {
5252
client.write('hello\r\n');
5353
}, 500);
5454

55-
if (exchanges == 5) {
55+
if (exchanges === 5) {
5656
console.log('wait for timeout - should come in ' + timeout + ' ms');
5757
starttime = new Date();
5858
console.dir(starttime);

test/pummel/test-net-timeout2.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var server = net.createServer(function(socket) {
2121
var interval = setInterval(function() {
2222
counter++;
2323

24-
if (counter == seconds) {
24+
if (counter === seconds) {
2525
clearInterval(interval);
2626
server.close();
2727
socket.destroy();

0 commit comments

Comments
 (0)