From 2f00b0add476bb151bc3a713da165296906cfc2a Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Fri, 11 Aug 2023 17:12:35 +0530 Subject: fix(ext/node): support dictionary option in zlib init (#20035) Fixes https://github.com/denoland/deno/issues/19540 --- cli/tests/unit_node/zlib_test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cli') diff --git a/cli/tests/unit_node/zlib_test.ts b/cli/tests/unit_node/zlib_test.ts index 96d392d1d..6b09c50b0 100644 --- a/cli/tests/unit_node/zlib_test.ts +++ b/cli/tests/unit_node/zlib_test.ts @@ -11,6 +11,7 @@ import { brotliDecompressSync, createBrotliCompress, createBrotliDecompress, + createDeflate, } from "node:zlib"; import { Buffer } from "node:buffer"; import { createReadStream, createWriteStream } from "node:fs"; @@ -60,3 +61,20 @@ Deno.test("brotli compression", async () => { // pass } }); + +Deno.test( + "zlib create deflate with dictionary", + { sanitizeResources: false }, + async () => { + const promise = deferred(); + const handle = createDeflate({ + dictionary: Buffer.alloc(0), + }); + + handle.on("close", () => promise.resolve()); + handle.end(); + handle.destroy(); + + await promise; + }, +); -- cgit v1.2.3