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 <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • 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.