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 12, 2017
1 parent e187c98 commit 6421a9c
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 @@ -52,7 +52,7 @@ function newParser(type) {
parser.url += url;
};

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

parser[kOnBody] = common.mustNotCall('kOnBody should not be called');
Expand Down Expand Up @@ -94,8 +94,7 @@ function expectBody(expected) {
const request = Buffer.from('GET /hello HTTP/1.1\r\n\r\n');

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 @@ -111,7 +110,7 @@ function expectBody(expected) {
// thrown from parser.execute()
//

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

Expand All @@ -136,8 +135,7 @@ function expectBody(expected) {
);

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 @@ -165,8 +163,7 @@ function expectBody(expected) {
'HTTP/1.0 200 Connection established\r\n\r\n');

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 @@ -199,15 +196,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 @@ -242,8 +238,7 @@ function expectBody(expected) {
);

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 @@ -272,8 +267,7 @@ function expectBody(expected) {
);

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 @@ -307,8 +301,7 @@ function expectBody(expected) {
);

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 @@ -346,8 +339,7 @@ function expectBody(expected) {
);

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 @@ -385,8 +377,7 @@ function expectBody(expected) {
);

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 @@ -445,8 +436,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 @@ -503,8 +493,7 @@ function expectBody(expected) {
);

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 @@ -557,8 +546,7 @@ function expectBody(expected) {
);

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 @@ -569,8 +557,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 6421a9c

Please sign in to comment.