- s390.patch: fix unit test on s390 with patched zlib

OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs18?expand=0&rev=39
This commit is contained in:
2023-01-26 12:59:22 +00:00
committed by Git OBS Bridge
parent d2fd477a39
commit 65a950dd73
3 changed files with 54 additions and 38 deletions

28
s390.patch Normal file
View File

@@ -0,0 +1,28 @@
Index: node-v18.13.0/test/parallel/test-whatwg-webstreams-compression.js
===================================================================
--- node-v18.13.0.orig/test/parallel/test-whatwg-webstreams-compression.js
+++ node-v18.13.0/test/parallel/test-whatwg-webstreams-compression.js
@@ -20,11 +20,19 @@ async function test(format) {
const reader = gunzip.readable.getReader();
const writer = gzip.writable.getWriter();
+ let compressed_data = [];
+ const reader_function = ({ value, done }) => {
+ if (value)
+ compressed_data.push(value);
+ if (!done)
+ return reader.read().then(reader_function);
+ assert.strictEqual(dec.decode(Buffer.concat(compressed_data)), 'hello');
+ };
+ const reader_promise = reader.read().then(reader_function);
+
await Promise.all([
- reader.read().then(({ value, done }) => {
- assert.strictEqual(dec.decode(value), 'hello');
- }),
- reader.read().then(({ done }) => assert(done)),
+ reader_promise,
+ reader_promise.then(() => reader.read().then(({ done }) => assert(done))),
writer.write('hello'),
writer.close(),
]);