Skip to content

Commit cc9bb34

Browse files
Trottevanlucas
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 <targos@protonmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 4b6ed24 commit cc9bb34

5 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var before = 0;
1717
before = process.memoryUsage().rss;
1818

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

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var server = net.createServer(function(socket) {
1414
var interval = setInterval(function() {
1515
counter++;
1616

17-
if (counter == seconds) {
17+
if (counter === seconds) {
1818
clearInterval(interval);
1919
server.close();
2020
socket.destroy();

0 commit comments

Comments
 (0)