11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ciconst common = require('../common'); 31cb0ef41Sopenharmony_ciconst assert = require('assert'); 41cb0ef41Sopenharmony_ciconst { Readable, Writable, Transform } = require('stream'); 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ci{ 71cb0ef41Sopenharmony_ci const stream = new Readable({ 81cb0ef41Sopenharmony_ci objectMode: true, 91cb0ef41Sopenharmony_ci read: common.mustCall(() => { 101cb0ef41Sopenharmony_ci stream.push(undefined); 111cb0ef41Sopenharmony_ci stream.push(null); 121cb0ef41Sopenharmony_ci }) 131cb0ef41Sopenharmony_ci }); 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_ci stream.on('data', common.mustCall((chunk) => { 161cb0ef41Sopenharmony_ci assert.strictEqual(chunk, undefined); 171cb0ef41Sopenharmony_ci })); 181cb0ef41Sopenharmony_ci} 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_ci{ 211cb0ef41Sopenharmony_ci const stream = new Writable({ 221cb0ef41Sopenharmony_ci objectMode: true, 231cb0ef41Sopenharmony_ci write: common.mustCall((chunk) => { 241cb0ef41Sopenharmony_ci assert.strictEqual(chunk, undefined); 251cb0ef41Sopenharmony_ci }) 261cb0ef41Sopenharmony_ci }); 271cb0ef41Sopenharmony_ci 281cb0ef41Sopenharmony_ci stream.write(undefined); 291cb0ef41Sopenharmony_ci} 301cb0ef41Sopenharmony_ci 311cb0ef41Sopenharmony_ci{ 321cb0ef41Sopenharmony_ci const stream = new Transform({ 331cb0ef41Sopenharmony_ci objectMode: true, 341cb0ef41Sopenharmony_ci transform: common.mustCall((chunk) => { 351cb0ef41Sopenharmony_ci stream.push(chunk); 361cb0ef41Sopenharmony_ci }) 371cb0ef41Sopenharmony_ci }); 381cb0ef41Sopenharmony_ci 391cb0ef41Sopenharmony_ci stream.on('data', common.mustCall((chunk) => { 401cb0ef41Sopenharmony_ci assert.strictEqual(chunk, undefined); 411cb0ef41Sopenharmony_ci })); 421cb0ef41Sopenharmony_ci 431cb0ef41Sopenharmony_ci stream.write(undefined); 441cb0ef41Sopenharmony_ci} 45