From d4374ad6514b5825021597eb3fccdce241b66f70 Mon Sep 17 00:00:00 2001 From: Runite618 Date: Sun, 13 Aug 2017 20:23:20 +0100 Subject: [PATCH] test: refactor async-hooks/test-httparser tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CRLF variable was defined but only used on line 22 so the variable was deleted and placed inside line 22 as a string literal. This was in file test-httpparser.request.js On line 46 there's a function declared that takes 3 arguments but none of them are ever used so removed. This is in file test-httpparser.response.js PR-URL: https://github.com/nodejs/node/pull/14818 Reviewed-By: Vse Mozhet Byt Reviewed-By: Alexey Orlenko Reviewed-By: Gireesh Punathil Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott Reviewed-By: Refael Ackermann Reviewed-By: James M Snell --- test/async-hooks/test-httpparser.request.js | 3 +-- test/async-hooks/test-httpparser.response.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test/async-hooks/test-httpparser.request.js b/test/async-hooks/test-httpparser.request.js index ca15172de1..c6e18be5a6 100644 --- a/test/async-hooks/test-httpparser.request.js +++ b/test/async-hooks/test-httpparser.request.js @@ -9,7 +9,6 @@ const { checkInvocations } = require('./hook-checks'); const binding = process.binding('http_parser'); const HTTPParser = binding.HTTPParser; -const CRLF = '\r\n'; const REQUEST = HTTPParser.REQUEST; const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0; @@ -19,7 +18,7 @@ const hooks = initHooks(); hooks.enable(); const request = Buffer.from( - 'GET /hello HTTP/1.1' + CRLF + CRLF + 'GET /hello HTTP/1.1\r\n\r\n' ); const parser = new HTTPParser(REQUEST); diff --git a/test/async-hooks/test-httpparser.response.js b/test/async-hooks/test-httpparser.response.js index 5723ac6fbd..d56e3e1fec 100644 --- a/test/async-hooks/test-httpparser.response.js +++ b/test/async-hooks/test-httpparser.response.js @@ -43,7 +43,7 @@ function onheadersComplete() { 'when onheadersComplete called'); } -function onbody(buf, start, len) { +function onbody() { checkInvocations(httpparser, { init: 1, before: 2, after: 1 }, 'when onbody called'); tick(1, common.mustCall(tick1));