From cfc92c2fb860f9c8923fc938c970fd8727cc7e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=BDubor=20Illek?= Date: Thu, 10 Jan 2019 01:08:10 +0100 Subject: [PATCH] Replaced Buffer() in inflate tests with dictionary. --- test/inflate.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/inflate.js b/test/inflate.js index 108e712..464eae7 100644 --- a/test/inflate.js +++ b/test/inflate.js @@ -169,15 +169,15 @@ describe('Inflate with dictionary', function () { it('should throw on the wrong dictionary', function () { // var zCompressed = helpers.deflateSync('world', { dictionary: new Buffer('hello') }); - var zCompressed = new Buffer([ 120, 187, 6, 44, 2, 21, 43, 207, 47, 202, 73, 1, 0, 6, 166, 2, 41 ]); + var zCompressed = new Uint8Array([ 120, 187, 6, 44, 2, 21, 43, 207, 47, 202, 73, 1, 0, 6, 166, 2, 41 ]); assert.throws(function () { - pako.inflate(zCompressed, { dictionary: new Buffer('world') }); + pako.inflate(zCompressed, { dictionary: 'world' }); }, /data error/); }); it('trivial dictionary', function () { - var dict = new Buffer('abcdefghijklmnoprstuvwxyz'); + var dict = 'abcdefghijklmnoprstuvwxyz'; testInflate(samples, { dictionary: dict }, { dictionary: dict }); }); @@ -187,7 +187,7 @@ describe('Inflate with dictionary', function () { }); it('should throw if directory is not supplied to raw inflate', function () { - var dict = new Buffer('abcdefghijklmnoprstuvwxyz'); + var dict = 'abcdefghijklmnoprstuvwxyz'; assert.throws(function () { testInflate(samples, { raw: true }, { raw: true, dictionary: dict }); });