From 70d3b808a077c54efc46016640fbc34d5d86458d 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 d65459198a3547..69981d4dc38b73 100644 --- a/test/parallel/test-buffer-slow.js +++ b/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 typed array length$/); assert.throws(function() { SlowBuffer(-1); -}, 'invalid Buffer length'); +}, /^RangeError: Invalid typed array length$/); assert.throws(function() { SlowBuffer(buffer.kMaxLength + 1); -}, 'invalid Buffer length'); +}, /^RangeError: (Invalid typed array length|Array buffer allocation failed)$/);