summaryrefslogtreecommitdiff
path: root/test/parallel/test-buffer-constants.js
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2017-08-14 12:54:05 +0200
committerAnna Henningsen <anna@addaleax.net>2017-08-17 20:32:26 +0200
commit9ecc4406421dcc89a010000b1253d3ad0efae64a (patch)
tree35a9d58a97f45c13d3175399d109925f9ad022c9 /test/parallel/test-buffer-constants.js
parentf853baf5443d9e3022bde865de759623e9bdd1ca (diff)
downloadandroid-node-v8-9ecc4406421dcc89a010000b1253d3ad0efae64a.tar.gz
android-node-v8-9ecc4406421dcc89a010000b1253d3ad0efae64a.tar.bz2
android-node-v8-9ecc4406421dcc89a010000b1253d3ad0efae64a.zip
buffer: fix MAX_LENGTH constant export
This was a typo and accidentally returned the wrong value. Fixes: https://github.com/nodejs/node/issues/14819 Ref: https://github.com/nodejs/node/pull/13467 PR-URL: https://github.com/nodejs/node/pull/14821 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Diffstat (limited to 'test/parallel/test-buffer-constants.js')
-rw-r--r--test/parallel/test-buffer-constants.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/parallel/test-buffer-constants.js b/test/parallel/test-buffer-constants.js
index 59f5b6d0de..820c8dc993 100644
--- a/test/parallel/test-buffer-constants.js
+++ b/test/parallel/test-buffer-constants.js
@@ -2,6 +2,7 @@
require('../common');
const assert = require('assert');
+const { kMaxLength, kStringMaxLength } = require('buffer');
const { MAX_LENGTH, MAX_STRING_LENGTH } = require('buffer').constants;
assert.strictEqual(typeof MAX_LENGTH, 'number');
@@ -11,3 +12,7 @@ assert.throws(() => ' '.repeat(MAX_STRING_LENGTH + 1),
/^RangeError: Invalid string length$/);
assert.doesNotThrow(() => ' '.repeat(MAX_STRING_LENGTH));
+
+// Legacy values match:
+assert.strictEqual(kMaxLength, MAX_LENGTH);
+assert.strictEqual(kStringMaxLength, MAX_STRING_LENGTH);