mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
chore(core): fix zlib_test sanitizer failures (#22659)
This commit is contained in:
parent
736b91edd0
commit
22a4205a68
1 changed files with 7 additions and 6 deletions
|
@ -44,7 +44,7 @@ Deno.test("gzip compression sync", { sanitizeResources: false }, () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Deno.test("brotli compression", async () => {
|
Deno.test("brotli compression", async () => {
|
||||||
const { promise, resolve } = Promise.withResolvers<void>();
|
const promise = Promise.withResolvers<void>();
|
||||||
const compress = createBrotliCompress();
|
const compress = createBrotliCompress();
|
||||||
const filePath = relative(
|
const filePath = relative(
|
||||||
Deno.cwd(),
|
Deno.cwd(),
|
||||||
|
@ -61,13 +61,14 @@ Deno.test("brotli compression", async () => {
|
||||||
const output2 = createWriteStream("lorem_ipsum.txt");
|
const output2 = createWriteStream("lorem_ipsum.txt");
|
||||||
|
|
||||||
const stream2 = input2.pipe(decompress).pipe(output2);
|
const stream2 = input2.pipe(decompress).pipe(output2);
|
||||||
|
stream2.on("close", () => promise.resolve());
|
||||||
stream2.on("finish", () => {
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await promise;
|
await Promise.all([
|
||||||
|
promise.promise,
|
||||||
|
new Promise((r) => stream.on("close", r)),
|
||||||
|
]);
|
||||||
|
|
||||||
const content = Deno.readTextFileSync("lorem_ipsum.txt");
|
const content = Deno.readTextFileSync("lorem_ipsum.txt");
|
||||||
assert(content.startsWith("Lorem ipsum dolor sit amet"));
|
assert(content.startsWith("Lorem ipsum dolor sit amet"));
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue