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 <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
ulisesantana authored and BridgeAR committed Nov 13, 2018
1 parent 768425f commit b02eed5
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 b02eed5

Please sign in to comment.