@@ -22,9 +22,7 @@ const tsp = require('timers/promises');
2222 let finished = false ;
2323 const processed = [ ] ;
2424 const expected = [
25- Buffer . from ( 'a' ) ,
26- Buffer . from ( 'b' ) ,
27- Buffer . from ( 'c' ) ,
25+ Buffer . from ( 'abc' ) ,
2826 ] ;
2927
3028 const read = new Readable ( {
@@ -217,10 +215,9 @@ const tsp = require('timers/promises');
217215 let sent = 0 ;
218216 const rs = new Readable ( {
219217 read ( ) {
220- if ( sent ++ > 10 ) {
221- return ;
222- }
223- rs . push ( 'hello' ) ;
218+ setImmediate ( ( ) => {
219+ rs . push ( 'hello' ) ;
220+ } ) ;
224221 } ,
225222 destroy : common . mustCall ( ( err , cb ) => {
226223 cb ( ) ;
@@ -348,8 +345,7 @@ const tsp = require('timers/promises');
348345 } ;
349346
350347 const expected = [
351- Buffer . from ( 'hello' ) ,
352- Buffer . from ( 'world' ) ,
348+ Buffer . from ( 'helloworld' ) ,
353349 ] ;
354350
355351 const rs = new Readable ( {
@@ -985,7 +981,7 @@ const tsp = require('timers/promises');
985981 // Make sure 'close' before 'end' finishes without error
986982 // if readable has received eof.
987983 // Ref: https://github.com/nodejs/node/issues/29699
988- const r = new Readable ( ) ;
984+ const r = new Readable ( ( { read ( ) { } } ) ) ;
989985 const w = new Writable ( {
990986 write ( chunk , encoding , cb ) {
991987 cb ( ) ;
@@ -1350,7 +1346,7 @@ const tsp = require('timers/promises');
13501346 } ) ;
13511347 const cb = common . mustCall ( ( err ) => {
13521348 assert . strictEqual ( err . name , 'AbortError' ) ;
1353- assert . strictEqual ( res , '012345 ' ) ;
1349+ assert . strictEqual ( res , '01234 ' ) ;
13541350 assert . strictEqual ( w . destroyed , true ) ;
13551351 assert . strictEqual ( r . destroyed , true ) ;
13561352 assert . strictEqual ( pipelined . destroyed , true ) ;
0 commit comments