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.
  • Loading branch information
targos committed Nov 27, 2016
1 parent 6b2aa1a commit 58c0078
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 @@ -51,10 +51,10 @@ assert.strictEqual(SlowBuffer('string').length, 0);
// should throw with invalid length
assert.throws(function() {
SlowBuffer(Infinity);
}, 'invalid Buffer length');
}, /^RangeError: Invalid array buffer length$/);
assert.throws(function() {
SlowBuffer(-1);
}, 'invalid Buffer length');
}, /^RangeError: Invalid array buffer length$/);
assert.throws(function() {
SlowBuffer(buffer.kMaxLength + 1);
}, 'invalid Buffer length');
}, /^RangeError: (Invalid typed array length|Array buffer allocation failed)$/);

0 comments on commit 58c0078

Please sign in to comment.