mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
20285ad177 changed the format
of error messages throughout lib. However, the tests were not
updated to reflect these changes. This commit makes those
changes.
PR-URL: https://github.com/nodejs/node/pull/3727
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
24 lines
602 B
JavaScript
24 lines
602 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 buf0 = new Buffer(kStringMaxLength * 2 + 2);
|
|
|
|
assert.throws(function() {
|
|
buf0.toString('utf16le');
|
|
}, /"toString\(\)" failed/);
|