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:
Michaël Zasso committed 2016-12-27 13:06:16 +01:00
1 parent e72dfce2c8
commit e0c8aafad8
1 file changed
+3 -3
+3 -3
View File
@@ -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)$/);