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 authored and addaleax committed Dec 5, 2016
1 parent e2db5c8 commit 74c3283
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 74c3283

Please sign in to comment.