Skip to content

Commit

Permalink
test: fix test-buffer-slow
Browse files Browse the repository at this point in the history
Fix incorrect use of string instead of RegExp in `throws` assertions.

PR-URL: nodejs#9809
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Prince John Wesley <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
targos committed Dec 26, 2016
1 parent 8694811 commit 433cbb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/parallel/test-buffer-slow.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ assert.strictEqual(SlowBuffer('string').length, 0);
// should throw with invalid length
assert.throws(function() {
new SlowBuffer(Infinity);
}, 'invalid Buffer length');
}, /^RangeError: Invalid typed array length$/);
assert.throws(function() {
new SlowBuffer(-1);
}, 'invalid Buffer length');
}, /^RangeError: Invalid typed array length$/);
assert.throws(function() {
new SlowBuffer(buffer.kMaxLength + 1);
}, 'invalid Buffer length');
}, /^RangeError: (Invalid typed array length|Array buffer allocation failed)$/);

0 comments on commit 433cbb7

Please sign in to comment.