Skip to content

Commit

Permalink
test: loose the error message regexp for platform differences
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Dec 6, 2016
1 parent 1277c6a commit c679654
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/parallel/test-buffer-regression-649.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ const SlowBuffer = require('buffer').SlowBuffer;

// Regression test for https://github.com/nodejs/node/issues/649.
const len = 1422561062959;
const lenLimitMsg = /^RangeError: Invalid typed array length$/;
const lenLimitMsg = new RegExp('^RangeError: (Invalid typed array length' +
'|Array buffer allocation failed' +
'|Invalid array buffer length)$');

assert.throws(() => Buffer(len).toString('utf8'), lenLimitMsg);
assert.throws(() => SlowBuffer(len).toString('utf8'), lenLimitMsg);
assert.throws(() => Buffer.alloc(len).toString('utf8'), lenLimitMsg);
Expand Down

0 comments on commit c679654

Please sign in to comment.