mirror of
https://github.com/nodejs/node.git
synced 2025-05-18 17:26:24 +00:00

Fixes a persistently troublesome failing test by splitting it out into multiple parallel tests. Reviewed By: Evan Lucas <evanlucas@me.com> Reviewed By: Trevor Norris <trev.norris@gmail.com> Reviewed By: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/3287
23 lines
601 B
JavaScript
23 lines
601 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
// v8 fails silently if string length > v8::String::kMaxLength
|
|
// v8::String::kMaxLength defined in v8.h
|
|
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
|
|
|
try {
|
|
new Buffer(kStringMaxLength * 3);
|
|
} catch(e) {
|
|
assert.equal(e.message, 'Invalid array buffer length');
|
|
console.log(
|
|
'1..0 # Skipped: intensive toString tests due to memory confinements');
|
|
return;
|
|
}
|
|
|
|
const buf = new Buffer(kStringMaxLength);
|
|
|
|
const maxString = buf.toString('binary');
|
|
assert.equal(maxString.length, kStringMaxLength);
|