Skip to content

Commit c679654

Browse files
committed
test: loose the error message regexp for platform differences
1 parent 1277c6a commit c679654

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/parallel/test-buffer-regression-649.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ const SlowBuffer = require('buffer').SlowBuffer;
66

77
// Regression test for https://github.com/nodejs/node/issues/649.
88
const len = 1422561062959;
9-
const lenLimitMsg = /^RangeError: Invalid typed array length$/;
9+
const lenLimitMsg = new RegExp('^RangeError: (Invalid typed array length' +
10+
'|Array buffer allocation failed' +
11+
'|Invalid array buffer length)$');
12+
1013
assert.throws(() => Buffer(len).toString('utf8'), lenLimitMsg);
1114
assert.throws(() => SlowBuffer(len).toString('utf8'), lenLimitMsg);
1215
assert.throws(() => Buffer.alloc(len).toString('utf8'), lenLimitMsg);

0 commit comments

Comments
 (0)