Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: fix test-buffer-slow
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
commit 433cbb70a6172017fac2cd5b34cbb25a1f0f8b2f
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)$/);