Browse Source

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>
v6
Michaël Zasso 8 years ago
parent
commit
efcbf611d7
  1. 6
      test/parallel/test-buffer-slow.js

6
test/parallel/test-buffer-slow.js

@ -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…
Cancel
Save