Skip to content

Commit 1c6a551

Browse files
chucktheobaldjasnell
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 e345897 commit 1c6a551

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ const { WriteWrap } = internalBinding('stream_wrap');
1010
const server = new TCP(TCPConstants.SOCKET);
1111

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

1818
server.listen(128);
1919

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

2424
const maybeCloseClient = () => {
@@ -34,7 +34,7 @@ server.onconnection = (err, client) => {
3434
if (buffer) {
3535
assert.ok(buffer.length > 0);
3636

37-
assert.strictEqual(0, client.writeQueueSize);
37+
assert.strictEqual(client.writeQueueSize, 0);
3838

3939
const req = new WriteWrap();
4040
req.async = false;
@@ -44,23 +44,23 @@ server.onconnection = (err, client) => {
4444

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

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

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

5757
// Check parameters.
58-
assert.strictEqual(0, status);
59-
assert.strictEqual(client, client_);
60-
assert.strictEqual(req, req_);
58+
assert.strictEqual(status, 0);
59+
assert.strictEqual(client_, client);
60+
assert.strictEqual(req_, req);
6161

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

6565
maybeCloseClient();
6666
}
@@ -82,7 +82,7 @@ c.on('connect', common.mustCall(() => { c.end('hello world'); }));
8282

8383
c.setEncoding('utf8');
8484
c.on('data', common.mustCall((d) => {
85-
assert.strictEqual('hello world', d);
85+
assert.strictEqual(d, 'hello world');
8686
}));
8787

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

0 commit comments

Comments
 (0)