test: fix test-buffer-slow
Fix incorrect use of string instead of RegExp in `throws` assertions. PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
e74b724e73
commit
efcbf611d7
@ -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)$/);
|
||||
|
Loading…
x
Reference in New Issue
Block a user