diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2023-08-11 17:12:35 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-11 11:42:35 +0000 |
commit | 2f00b0add476bb151bc3a713da165296906cfc2a (patch) | |
tree | ba43cae2dd787b8e0f0aae102210ecfb65aa2f90 /cli | |
parent | 65db8814c31464f2bc2a04dd5ffbaa71361c9f80 (diff) |
fix(ext/node): support dictionary option in zlib init (#20035)
Fixes https://github.com/denoland/deno/issues/19540
Diffstat (limited to 'cli')
-rw-r--r-- | cli/tests/unit_node/zlib_test.ts | 18 |
1 files changed, 18 insertions, 0 deletions
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; + }, +); |