mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
test: add arrayOfStreams to pipeline
PR-URL: https://github.com/nodejs/node/pull/34156 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
@@ -1211,3 +1211,23 @@ const net = require('net');
|
||||
d.write('test');
|
||||
d.end();
|
||||
}
|
||||
|
||||
{
|
||||
const r = new Readable({
|
||||
read() {}
|
||||
});
|
||||
r.push('hello');
|
||||
r.push('world');
|
||||
r.push(null);
|
||||
let res = '';
|
||||
const w = new Writable({
|
||||
write(chunk, encoding, callback) {
|
||||
res += chunk;
|
||||
callback();
|
||||
}
|
||||
});
|
||||
pipeline([r, w], common.mustCall((err) => {
|
||||
assert.ok(!err);
|
||||
assert.strictEqual(res, 'helloworld');
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user