aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-buffer-slow.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-buffer-slow.js')
-rw-r--r--test/parallel/test-buffer-slow.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/parallel/test-buffer-slow.js b/test/parallel/test-buffer-slow.js
index 7d27a9be11..bb944ae4de 100644
--- a/test/parallel/test-buffer-slow.js
+++ b/test/parallel/test-buffer-slow.js
@@ -1,6 +1,6 @@
'use strict';
-require('../common');
+const common = require('../common');
const assert = require('assert');
const buffer = require('buffer');
const Buffer = buffer.Buffer;
@@ -51,10 +51,10 @@ assert.strictEqual(SlowBuffer('string').length, 0);
// should throw with invalid length
assert.throws(function() {
SlowBuffer(Infinity);
-}, /^RangeError: Invalid array buffer length$/);
+}, common.bufferMaxSizeMsg);
assert.throws(function() {
SlowBuffer(-1);
-}, /^RangeError: Invalid array buffer length$/);
+}, /^RangeError: "size" argument must not be negative$/);
assert.throws(function() {
SlowBuffer(buffer.kMaxLength + 1);
-}, /^RangeError: (Invalid typed array length|Array buffer allocation failed)$/);
+}, common.bufferMaxSizeMsg);