summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFedor Indutny <fedor@indutny.com>2018-10-29 22:06:09 -0400
committerFedor Indutny <fedor@indutny.com>2018-11-10 17:54:21 -0500
commitd4654d89be0c20f8ca1e153d074a236348618b00 (patch)
treef6aa2013a63ad85987bdef23fa82f1eade6d08ee /test
parentd3f02d0da3d574b91a15d3ace10e76014b7574fc (diff)
downloadandroid-node-v8-d4654d89be0c20f8ca1e153d074a236348618b00.tar.gz
android-node-v8-d4654d89be0c20f8ca1e153d074a236348618b00.tar.bz2
android-node-v8-d4654d89be0c20f8ca1e153d074a236348618b00.zip
deps: introduce `llhttp`
llhttp is modern, written in human-readable TypeScript, verifiable, and is very easy to maintain. See: https://github.com/indutny/llhttp PR-URL: https://github.com/nodejs/node/pull/24059 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-http-parser-bad-ref.js2
-rw-r--r--test/parallel/test-process-versions.js8
-rw-r--r--test/parallel/test-trace-events-metadata.js5
-rw-r--r--test/sequential/test-async-wrap-getasyncid.js2
4 files changed, 11 insertions, 6 deletions
diff --git a/test/parallel/test-http-parser-bad-ref.js b/test/parallel/test-http-parser-bad-ref.js
index aca94361b4..5b002b2ce0 100644
--- a/test/parallel/test-http-parser-bad-ref.js
+++ b/test/parallel/test-http-parser-bad-ref.js
@@ -25,7 +25,7 @@ function flushPool() {
function demoBug(part1, part2) {
flushPool();
- const parser = new HTTPParser(0);
+ const parser = new HTTPParser(HTTPParser.REQUEST);
parser.headers = [];
parser.url = '';
diff --git a/test/parallel/test-process-versions.js b/test/parallel/test-process-versions.js
index e8527fe574..ba7b9e70b2 100644
--- a/test/parallel/test-process-versions.js
+++ b/test/parallel/test-process-versions.js
@@ -2,7 +2,7 @@
const common = require('../common');
const assert = require('assert');
-const expected_keys = ['ares', 'http_parser', 'modules', 'node',
+const expected_keys = ['ares', 'modules', 'node',
'uv', 'v8', 'zlib', 'nghttp2', 'napi'];
if (common.hasCrypto) {
@@ -16,6 +16,9 @@ if (common.hasIntl) {
expected_keys.push('unicode');
}
+expected_keys.push(
+ process.versions.llhttp === undefined ? 'http_parser' : 'llhttp');
+
expected_keys.sort();
const actual_keys = Object.keys(process.versions).sort();
@@ -24,7 +27,8 @@ assert.deepStrictEqual(actual_keys, expected_keys);
const commonTemplate = /^\d+\.\d+\.\d+(?:-.*)?$/;
assert(commonTemplate.test(process.versions.ares));
-assert(commonTemplate.test(process.versions.http_parser));
+assert(commonTemplate.test(process.versions.llhttp === undefined ?
+ process.versions.http_parser : process.versions.llhttp));
assert(commonTemplate.test(process.versions.node));
assert(commonTemplate.test(process.versions.uv));
assert(commonTemplate.test(process.versions.zlib));
diff --git a/test/parallel/test-trace-events-metadata.js b/test/parallel/test-trace-events-metadata.js
index 951f398404..0db8555838 100644
--- a/test/parallel/test-trace-events-metadata.js
+++ b/test/parallel/test-trace-events-metadata.js
@@ -36,8 +36,9 @@ proc.once('exit', common.mustCall(() => {
assert(traces.some((trace) =>
trace.name === 'node' &&
- trace.args.process.versions.http_parser ===
- process.versions.http_parser &&
+ (trace.args.process.versions.http_parser ===
+ process.versions.http_parser ||
+ trace.args.process.versions.llhttp === process.versions.llhttp) &&
trace.args.process.versions.node ===
process.versions.node &&
trace.args.process.versions.v8 ===
diff --git a/test/sequential/test-async-wrap-getasyncid.js b/test/sequential/test-async-wrap-getasyncid.js
index 851a0b3fbc..4ebe3e0472 100644
--- a/test/sequential/test-async-wrap-getasyncid.js
+++ b/test/sequential/test-async-wrap-getasyncid.js
@@ -149,7 +149,7 @@ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
{
const { HTTPParser } = internalBinding('http_parser');
- testInitialized(new HTTPParser(0), 'HTTPParser');
+ testInitialized(new HTTPParser(HTTPParser.REQUEST), 'HTTPParser');
}