Skip to content

Commit fad9d80

Browse files
chucktheobaldMylesBorins
authored andcommitted
test: change order of assert.strictEquals arguments
Fix assert.strictEquals argument order. Arguments were actual first, expected second, contrary to the documentation. Now, actual value is first and expected value is second. PR-URL: #23600 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
1 parent 07c8a9e commit fad9d80

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/parallel/test-tcp-wrap-listen.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ const WriteWrap = process.binding('stream_wrap').WriteWrap;
88
const server = new TCP(TCPConstants.SOCKET);
99

1010
const r = server.bind('0.0.0.0', 0);
11-
assert.strictEqual(0, r);
11+
assert.strictEqual(r, 0);
1212
let port = {};
1313
server.getsockname(port);
1414
port = port.port;
1515

1616
server.listen(128);
1717

1818
server.onconnection = (err, client) => {
19-
assert.strictEqual(0, client.writeQueueSize);
19+
assert.strictEqual(client.writeQueueSize, 0);
2020
console.log('got connection');
2121

2222
const maybeCloseClient = () => {
@@ -32,7 +32,7 @@ server.onconnection = (err, client) => {
3232
if (buffer) {
3333
assert.ok(buffer.length > 0);
3434

35-
assert.strictEqual(0, client.writeQueueSize);
35+
assert.strictEqual(client.writeQueueSize, 0);
3636

3737
const req = new WriteWrap();
3838
req.async = false;
@@ -42,23 +42,23 @@ server.onconnection = (err, client) => {
4242

4343
console.log(`client.writeQueueSize: ${client.writeQueueSize}`);
4444
// 11 bytes should flush
45-
assert.strictEqual(0, client.writeQueueSize);
45+
assert.strictEqual(client.writeQueueSize, 0);
4646

4747
if (req.async)
4848
req.oncomplete = common.mustCall(done);
4949
else
5050
process.nextTick(done.bind(null, 0, client, req));
5151

5252
function done(status, client_, req_) {
53-
assert.strictEqual(req, client.pendingWrites.shift());
53+
assert.strictEqual(client.pendingWrites.shift(), req);
5454

5555
// Check parameters.
56-
assert.strictEqual(0, status);
57-
assert.strictEqual(client, client_);
58-
assert.strictEqual(req, req_);
56+
assert.strictEqual(status, 0);
57+
assert.strictEqual(client_, client);
58+
assert.strictEqual(req_, req);
5959

6060
console.log(`client.writeQueueSize: ${client.writeQueueSize}`);
61-
assert.strictEqual(0, client.writeQueueSize);
61+
assert.strictEqual(client.writeQueueSize, 0);
6262

6363
maybeCloseClient();
6464
}
@@ -80,7 +80,7 @@ c.on('connect', common.mustCall(() => { c.end('hello world'); }));
8080

8181
c.setEncoding('utf8');
8282
c.on('data', common.mustCall((d) => {
83-
assert.strictEqual('hello world', d);
83+
assert.strictEqual(d, 'hello world');
8484
}));
8585

8686
c.on('close', () => {

0 commit comments

Comments
 (0)