Skip to content

Commit

Permalink
test: fix arguments order in assert.strictEqual()
Browse files Browse the repository at this point in the history
PR-URL: #24192
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
ulisesantana authored and MylesBorins committed Dec 26, 2018
1 parent 3bb6372 commit 2359273
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions test/parallel/test-http-1.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ function test(handler, request_generator, response_validator) {

{
function handler(req, res) {
assert.strictEqual('1.0', req.httpVersion);
assert.strictEqual(1, req.httpVersionMajor);
assert.strictEqual(0, req.httpVersionMinor);
assert.strictEqual(req.httpVersion, '1.0');
assert.strictEqual(req.httpVersionMajor, 1);
assert.strictEqual(req.httpVersionMinor, 0);
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end(body);
}
Expand All @@ -72,8 +72,8 @@ function test(handler, request_generator, response_validator) {
function response_validator(server_response, client_got_eof, timed_out) {
const m = server_response.split('\r\n\r\n');
assert.strictEqual(m[1], body);
assert.strictEqual(true, client_got_eof);
assert.strictEqual(false, timed_out);
assert.strictEqual(client_got_eof, true);
assert.strictEqual(timed_out, false);
}

test(handler, request_generator, response_validator);
Expand All @@ -86,9 +86,9 @@ function test(handler, request_generator, response_validator) {
//
{
function handler(req, res) {
assert.strictEqual('1.0', req.httpVersion);
assert.strictEqual(1, req.httpVersionMajor);
assert.strictEqual(0, req.httpVersionMinor);
assert.strictEqual(req.httpVersion, '1.0');
assert.strictEqual(req.httpVersionMajor, 1);
assert.strictEqual(req.httpVersionMinor, 0);
res.sendDate = false;
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.write('Hello, '); res._send('');
Expand All @@ -112,19 +112,19 @@ function test(handler, request_generator, response_validator) {
'\r\n' +
'Hello, world!';

assert.strictEqual(expected_response, server_response);
assert.strictEqual(true, client_got_eof);
assert.strictEqual(false, timed_out);
assert.strictEqual(server_response, expected_response);
assert.strictEqual(client_got_eof, true);
assert.strictEqual(timed_out, false);
}

test(handler, request_generator, response_validator);
}

{
function handler(req, res) {
assert.strictEqual('1.1', req.httpVersion);
assert.strictEqual(1, req.httpVersionMajor);
assert.strictEqual(1, req.httpVersionMinor);
assert.strictEqual(req.httpVersion, '1.1');
assert.strictEqual(req.httpVersionMajor, 1);
assert.strictEqual(req.httpVersionMinor, 1);
res.sendDate = false;
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.write('Hello, '); res._send('');
Expand Down Expand Up @@ -155,9 +155,9 @@ function test(handler, request_generator, response_validator) {
'0\r\n' +
'\r\n';

assert.strictEqual(expected_response, server_response);
assert.strictEqual(true, client_got_eof);
assert.strictEqual(false, timed_out);
assert.strictEqual(server_response, expected_response);
assert.strictEqual(client_got_eof, true);
assert.strictEqual(timed_out, false);
}

test(handler, request_generator, response_validator);
Expand Down

0 comments on commit 2359273

Please sign in to comment.