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 21a46ef

Browse filesBrowse files
AllanZhengYPMylesBorins
authored andcommitted
test: reverse the order of assertion statement arguments in pingpong test
PR-URL: #23540 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent e5500f8 commit 21a46ef
Copy full SHA for 21a46ef

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

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

Copy file name to clipboardExpand all lines: test/pummel/test-net-pingpong.js
+14-14Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ function pingPongTest(port, host, on_complete) {
3232
let sent_final_ping = false;
3333

3434
const server = net.createServer({ allowHalfOpen: true }, function(socket) {
35-
assert.strictEqual(true, socket.remoteAddress !== null);
36-
assert.strictEqual(true, socket.remoteAddress !== undefined);
35+
assert.strictEqual(socket.remoteAddress !== null, true);
36+
assert.strictEqual(socket.remoteAddress !== undefined, true);
3737
const address = socket.remoteAddress;
3838
if (host === '127.0.0.1') {
3939
assert.strictEqual(address, '127.0.0.1');
@@ -50,21 +50,21 @@ function pingPongTest(port, host, on_complete) {
5050

5151
socket.on('data', function(data) {
5252
console.log(`server got: ${JSON.stringify(data)}`);
53-
assert.strictEqual('open', socket.readyState);
54-
assert.strictEqual(true, count <= N);
53+
assert.strictEqual(socket.readyState, 'open');
54+
assert.strictEqual(count <= N, true);
5555
if (/PING/.test(data)) {
5656
socket.write('PONG');
5757
}
5858
});
5959

6060
socket.on('end', function() {
61-
assert.strictEqual('writeOnly', socket.readyState);
61+
assert.strictEqual(socket.readyState, 'writeOnly');
6262
socket.end();
6363
});
6464

6565
socket.on('close', function(had_error) {
66-
assert.strictEqual(false, had_error);
67-
assert.strictEqual('closed', socket.readyState);
66+
assert.strictEqual(had_error, false);
67+
assert.strictEqual(socket.readyState, 'closed');
6868
socket.server.close();
6969
});
7070
});
@@ -75,21 +75,21 @@ function pingPongTest(port, host, on_complete) {
7575
client.setEncoding('utf8');
7676

7777
client.on('connect', function() {
78-
assert.strictEqual('open', client.readyState);
78+
assert.strictEqual(client.readyState, 'open');
7979
client.write('PING');
8080
});
8181

8282
client.on('data', function(data) {
8383
console.log(`client got: ${data}`);
8484

85-
assert.strictEqual('PONG', data);
85+
assert.strictEqual(data, 'PONG');
8686
count += 1;
8787

8888
if (sent_final_ping) {
89-
assert.strictEqual('readOnly', client.readyState);
89+
assert.strictEqual(client.readyState, 'readOnly');
9090
return;
9191
} else {
92-
assert.strictEqual('open', client.readyState);
92+
assert.strictEqual(client.readyState, 'open');
9393
}
9494

9595
if (count < N) {
@@ -102,8 +102,8 @@ function pingPongTest(port, host, on_complete) {
102102
});
103103

104104
client.on('close', function() {
105-
assert.strictEqual(N + 1, count);
106-
assert.strictEqual(true, sent_final_ping);
105+
assert.strictEqual(count, N + 1);
106+
assert.strictEqual(sent_final_ping, true);
107107
if (on_complete) on_complete();
108108
tests_run += 1;
109109
});
@@ -118,5 +118,5 @@ pingPongTest(common.PORT + 1, null);
118118
if (!common.isSunOS) pingPongTest(common.PORT + 2, '::1');
119119

120120
process.on('exit', function() {
121-
assert.strictEqual(common.isSunOS ? 2 : 3, tests_run);
121+
assert.strictEqual(tests_run, common.isSunOS ? 2 : 3);
122122
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.