diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-08-02 15:44:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-02 16:44:32 +0200 |
commit | b82a2f114c7c936bf4398669453513ace478cb1d (patch) | |
tree | a0dd2aa94cf61103b1dbcfa28a6c67feebf6eedd /tests/unit_node/zlib_test.ts | |
parent | 7495bcbf77349d708b249944a149c16f5ee0c667 (diff) |
fix(ext/node): node:zlib coerces quality 10 to 9.5 (#24850)
Fixes https://github.com/denoland/deno/issues/24572
Diffstat (limited to 'tests/unit_node/zlib_test.ts')
-rw-r--r-- | tests/unit_node/zlib_test.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unit_node/zlib_test.ts b/tests/unit_node/zlib_test.ts index 215717dde..eb248c34d 100644 --- a/tests/unit_node/zlib_test.ts +++ b/tests/unit_node/zlib_test.ts @@ -6,6 +6,7 @@ import { brotliCompress, brotliCompressSync, brotliDecompressSync, + constants, createBrotliCompress, createBrotliDecompress, createDeflate, @@ -137,6 +138,19 @@ Deno.test("should work with a buffer from an encoded string", () => { assertEquals(decompressed.toString(), "hello world"); }); +// https://github.com/denoland/deno/issues/24572 +Deno.test("Brotli quality 10 doesn't panic", () => { + const e = brotliCompressSync("abc", { + params: { + [constants.BROTLI_PARAM_QUALITY]: 10, + }, + }); + assertEquals( + new Uint8Array(e.buffer), + new Uint8Array([11, 1, 128, 97, 98, 99, 3]), + ); +}); + Deno.test( "zlib compression with dataview", () => { |