Permalink
Browse files

test: remove unused arguments from function

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...
ankitiitb1069 authored and tniessen committed Aug 18, 2017
1 parent 342c5f9 commit 2a97eb61c65e23de3cee42c7b70f845b0c3a3d09
Showing with 16 additions and 29 deletions.
  1. +16 −29 test/parallel/test-http-parser.js
@@ -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');
@@ -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'));
@@ -111,7 +110,7 @@ function expectBody(expected) {
// thrown from parser.execute()
//
parser[kOnHeadersComplete] = function(info) {
parser[kOnHeadersComplete] = function() {
throw new Error('hello world');
};
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);

0 comments on commit 2a97eb6

Please sign in to comment.