From efcbf611d7b085fe9620c7e69104699920fab962 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 24bd9e1cfd..cecc01a959 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 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)$/);