From b4f1c205efdf998f512cbf5484445fc0b30f8051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=BDubor=20Illek?= Date: Thu, 10 Jan 2019 10:38:02 +0100 Subject: [PATCH] Added basic tests for inflate with dictionary as Uint8Array or ArrayBuffer --- test/inflate.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/inflate.js b/test/inflate.js index 464eae7..d7f7573 100644 --- a/test/inflate.js +++ b/test/inflate.js @@ -197,4 +197,16 @@ describe('Inflate with dictionary', function () { var spdyDict = require('fs').readFileSync(require('path').join(__dirname, 'fixtures', 'spdy_dict.txt')); testInflate(samples, { raw: true, dictionary: spdyDict }, { raw: true, dictionary: spdyDict }); }); + + it('tests dictionary as Uint8Array', function () { + var dict = new Uint8Array(100); + for (var i = 0; i < 100; i++) dict[i] = Math.random() * 256; + testInflate(samples, { dictionary: dict }, { dictionary: dict }); + }); + + it('tests dictionary as ArrayBuffer', function () { + var dict = new Uint8Array(100); + for (var i = 0; i < 100; i++) dict[i] = Math.random() * 256; + testInflate(samples, { dictionary: dict.buffer }, { dictionary: dict }); + }); });