Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cc9bb34

Browse filesBrowse 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
Copy full SHA for cc9bb34

File tree

Expand file treeCollapse file tree

5 files changed

+5
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

5 files changed

+5
-5
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/pummel/test-net-connect-econnrefused.js
+1-1Lines 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
});
Collapse file

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

Copy file name to clipboardExpand all lines: test/pummel/test-net-connect-memleak.js
+1-1Lines 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
});
Collapse file

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

Copy file name to clipboardExpand all lines: test/pummel/test-net-many-clients.js
+1-1Lines 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
});
Collapse file

‎test/pummel/test-net-timeout.js‎

Copy file name to clipboardExpand all lines: test/pummel/test-net-timeout.js
+1-1Lines 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);
Collapse file

‎test/pummel/test-net-timeout2.js‎

Copy file name to clipboardExpand all lines: test/pummel/test-net-timeout2.js
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.