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: #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 3d368d0 commit 70d3b80
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 typed array length$/);
assert.throws(function() {
SlowBuffer(-1);
}, 'invalid Buffer length');
}, /^RangeError: Invalid typed array length$/);
assert.throws(function() {
SlowBuffer(buffer.kMaxLength + 1);
}, 'invalid Buffer length');
}, /^RangeError: (Invalid typed array length|Array buffer allocation failed)$/);

0 comments on commit 70d3b80

Please sign in to comment.