From e0c8aafad88afdd90ced6e5500adfde72481efd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 26 Nov 2016 10:28:18 +0100 Subject: [PATCH] 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 Reviewed-By: Rich Trott Reviewed-By: Prince John Wesley Reviewed-By: Michael Dawson --- test/parallel/test-buffer-slow.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-buffer-slow.js b/test/parallel/test-buffer-slow.js index 8a37fc60f79904..9064e07f4910cc 100644 --- a/test/parallel/test-buffer-slow.js +++ b/test/parallel/test-buffer-slow.js @@ -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)$/);