mirror of
https://github.com/nodejs/node.git
synced 2025-05-05 19:08:17 +00:00

Remove duplication of buffer tests, separate out into separate files, update and cleanup code, move to using strictEqual where possible. PR-URL: https://github.com/nodejs/node/pull/8256 Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
14 lines
507 B
JavaScript
14 lines
507 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const SlowBuffer = require('buffer').SlowBuffer;
|
|
|
|
// Regression test for https://github.com/nodejs/node/issues/649.
|
|
const len = 1422561062959;
|
|
assert.throws(() => Buffer(len).toString('utf8'));
|
|
assert.throws(() => SlowBuffer(len).toString('utf8'));
|
|
assert.throws(() => Buffer.alloc(len).toString('utf8'));
|
|
assert.throws(() => Buffer.allocUnsafe(len).toString('utf8'));
|
|
assert.throws(() => Buffer.allocUnsafeSlow(len).toString('utf8'));
|