summaryrefslogtreecommitdiff
path: root/tests/unit_node
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2024-03-12 17:23:31 +0530
committerGitHub <noreply@github.com>2024-03-12 17:23:31 +0530
commit4a88695563ced73e18a97be06f9f0864be683eff (patch)
tree65837c501c755cf9f5339ce9d9e437a5a0d01724 /tests/unit_node
parentad6b00a2bf061a90c72737d0ecc4a58bb0a89550 (diff)
fix(ext/node): flush brotli decompression stream (#22856)
Fixes https://github.com/denoland/deno/issues/22259 The decompressed input size was not restored because of improper flushing of the CBrotliDecompressStream state.
Diffstat (limited to 'tests/unit_node')
-rw-r--r--tests/unit_node/zlib_test.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit_node/zlib_test.ts b/tests/unit_node/zlib_test.ts
index 94b1c63ca..fa09bd687 100644
--- a/tests/unit_node/zlib_test.ts
+++ b/tests/unit_node/zlib_test.ts
@@ -171,3 +171,13 @@ Deno.test("brotli large chunk size", async () => {
);
assertEquals(output.length, input.length);
});
+
+Deno.test("brotli decompress flush restore size", async () => {
+ const input = new Uint8Array(1000000);
+ const output = await buffer(
+ Readable.from([input])
+ .pipe(createBrotliCompress())
+ .pipe(createBrotliDecompress()),
+ );
+ assertEquals(output.length, input.length);
+});