Skip to content

Commit

Permalink
test: remove unused arguments from function
Browse files Browse the repository at this point in the history
Removed the unused arguments of functions defined in
file test/parallel/test-http-parser.js.

PR-URL: #14931
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
  • Loading branch information
0xparashar authored and MylesBorins committed Sep 20, 2017
1 parent 55dc14e commit 915b56b
Showing 1 changed file with 16 additions and 29 deletions.
45 changes: 16 additions & 29 deletions test/parallel/test-http-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function newParser(type) {
parser.url += url;
};

parser[kOnHeadersComplete] = function(info) {
parser[kOnHeadersComplete] = function() {
};

parser[kOnBody] = function(b, start, len) {
Expand Down Expand Up @@ -76,8 +76,7 @@ function expectBody(expected) {
const request = Buffer.from(`GET /hello HTTP/1.1${CRLF}${CRLF}`);

const onHeadersComplete = (versionMajor, versionMinor, headers,
method, url, statusCode, statusMessage,
upgrade, shouldKeepAlive) => {
method, url) => {
assert.strictEqual(versionMajor, 1);
assert.strictEqual(versionMinor, 1);
assert.strictEqual(method, methods.indexOf('GET'));
Expand All @@ -93,7 +92,7 @@ function expectBody(expected) {
// thrown from parser.execute()
//

parser[kOnHeadersComplete] = function(info) {
parser[kOnHeadersComplete] = function() {
throw new Error('hello world');
};

Expand All @@ -117,8 +116,7 @@ function expectBody(expected) {
'pong');

const onHeadersComplete = (versionMajor, versionMinor, headers,
method, url, statusCode, statusMessage,
upgrade, shouldKeepAlive) => {
method, url, statusCode, statusMessage) => {
assert.strictEqual(method, undefined);
assert.strictEqual(versionMajor, 1);
assert.strictEqual(versionMinor, 1);
Expand Down Expand Up @@ -146,8 +144,7 @@ function expectBody(expected) {
`HTTP/1.0 200 Connection established${CRLF}${CRLF}`);

const onHeadersComplete = (versionMajor, versionMinor, headers,
method, url, statusCode, statusMessage,
upgrade, shouldKeepAlive) => {
method, url, statusCode, statusMessage) => {
assert.strictEqual(versionMajor, 1);
assert.strictEqual(versionMinor, 0);
assert.strictEqual(method, undefined);
Expand Down Expand Up @@ -179,15 +176,14 @@ function expectBody(expected) {

let seen_body = false;

const onHeaders = (headers, url) => {
const onHeaders = (headers) => {
assert.ok(seen_body); // trailers should come after the body
assert.deepStrictEqual(headers,
['Vary', '*', 'Content-Type', 'text/plain']);
};

const onHeadersComplete = (versionMajor, versionMinor, headers,
method, url, statusCode, statusMessage,
upgrade, shouldKeepAlive) => {
method, url) => {
assert.strictEqual(method, methods.indexOf('POST'));
assert.strictEqual(url || parser.url, '/it');
assert.strictEqual(versionMajor, 1);
Expand Down Expand Up @@ -221,8 +217,7 @@ function expectBody(expected) {
CRLF);

const onHeadersComplete = (versionMajor, versionMinor, headers,
method, url, statusCode, statusMessage,
upgrade, shouldKeepAlive) => {
method) => {
assert.strictEqual(method, methods.indexOf('GET'));
assert.strictEqual(versionMajor, 1);
assert.strictEqual(versionMinor, 0);
Expand Down Expand Up @@ -250,8 +245,7 @@ function expectBody(expected) {
CRLF);

const onHeadersComplete = (versionMajor, versionMinor, headers,
method, url, statusCode, statusMessage,
upgrade, shouldKeepAlive) => {
method, url) => {
assert.strictEqual(method, methods.indexOf('GET'));
assert.strictEqual(url || parser.url, '/foo/bar/baz?quux=42#1337');
assert.strictEqual(versionMajor, 1);
Expand Down Expand Up @@ -284,8 +278,7 @@ function expectBody(expected) {
'foo=42&bar=1337');

const onHeadersComplete = (versionMajor, versionMinor, headers,
method, url, statusCode, statusMessage,
upgrade, shouldKeepAlive) => {
method, url) => {
assert.strictEqual(method, methods.indexOf('POST'));
assert.strictEqual(url || parser.url, '/it');
assert.strictEqual(versionMajor, 1);
Expand Down Expand Up @@ -322,8 +315,7 @@ function expectBody(expected) {
'0' + CRLF);

const onHeadersComplete = (versionMajor, versionMinor, headers,
method, url, statusCode, statusMessage,
upgrade, shouldKeepAlive) => {
method, url) => {
assert.strictEqual(method, methods.indexOf('POST'));
assert.strictEqual(url || parser.url, '/it');
assert.strictEqual(versionMajor, 1);
Expand Down Expand Up @@ -360,8 +352,7 @@ function expectBody(expected) {
'123456' + CRLF);

const onHeadersComplete = (versionMajor, versionMinor, headers,
method, url, statusCode, statusMessage,
upgrade, shouldKeepAlive) => {
method, url) => {
assert.strictEqual(method, methods.indexOf('POST'));
assert.strictEqual(url || parser.url, '/it');
assert.strictEqual(versionMajor, 1);
Expand Down Expand Up @@ -418,8 +409,7 @@ function expectBody(expected) {

function test(a, b) {
const onHeadersComplete = (versionMajor, versionMinor, headers,
method, url, statusCode, statusMessage,
upgrade, shouldKeepAlive) => {
method, url) => {
assert.strictEqual(method, methods.indexOf('POST'));
assert.strictEqual(url || parser.url, '/helpme');
assert.strictEqual(versionMajor, 1);
Expand Down Expand Up @@ -475,8 +465,7 @@ function expectBody(expected) {
'0' + CRLF);

const onHeadersComplete = (versionMajor, versionMinor, headers,
method, url, statusCode, statusMessage,
upgrade, shouldKeepAlive) => {
method, url) => {
assert.strictEqual(method, methods.indexOf('POST'));
assert.strictEqual(url || parser.url, '/it');
assert.strictEqual(versionMajor, 1);
Expand Down Expand Up @@ -527,8 +516,7 @@ function expectBody(expected) {
'pong');

const onHeadersComplete1 = (versionMajor, versionMinor, headers,
method, url, statusCode, statusMessage,
upgrade, shouldKeepAlive) => {
method, url) => {
assert.strictEqual(method, methods.indexOf('PUT'));
assert.strictEqual(url, '/this');
assert.strictEqual(versionMajor, 1);
Expand All @@ -539,8 +527,7 @@ function expectBody(expected) {
};

const onHeadersComplete2 = (versionMajor, versionMinor, headers,
method, url, statusCode, statusMessage,
upgrade, shouldKeepAlive) => {
method, url) => {
assert.strictEqual(method, methods.indexOf('POST'));
assert.strictEqual(url, '/that');
assert.strictEqual(versionMajor, 1);
Expand Down

0 comments on commit 915b56b

Please sign in to comment.