(r)
| 3 | const { Readable, PassThrough } = require('stream'); |
| 4 | |
| 5 | function test(r) { |
| 6 | const wrapper = new Readable({ |
| 7 | read: () => { |
| 8 | let data = r.read(); |
| 9 | |
| 10 | if (data) { |
| 11 | wrapper.push(data); |
| 12 | return; |
| 13 | } |
| 14 | |
| 15 | r.once('readable', function() { |
| 16 | data = r.read(); |
| 17 | if (data) { |
| 18 | wrapper.push(data); |
| 19 | } |
| 20 | // else: the end event should fire |
| 21 | }); |
| 22 | }, |
| 23 | }); |
| 24 | |
| 25 | r.once('end', function() { |
| 26 | wrapper.push(null); |
| 27 | }); |
| 28 | |
| 29 | wrapper.resume(); |
| 30 | wrapper.once('end', common.mustCall()); |
| 31 | } |
| 32 | |
| 33 | { |
| 34 | const source = new Readable({ |
no test coverage detected