11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_ciconst assert = require('assert');
51cb0ef41Sopenharmony_ciconst { Transform } = require('stream');
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciconst t = new Transform();
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ciassert.throws(
101cb0ef41Sopenharmony_ci  () => {
111cb0ef41Sopenharmony_ci    t.end(Buffer.from('blerg'));
121cb0ef41Sopenharmony_ci  },
131cb0ef41Sopenharmony_ci  {
141cb0ef41Sopenharmony_ci    name: 'Error',
151cb0ef41Sopenharmony_ci    code: 'ERR_METHOD_NOT_IMPLEMENTED',
161cb0ef41Sopenharmony_ci    message: 'The _transform() method is not implemented'
171cb0ef41Sopenharmony_ci  }
181cb0ef41Sopenharmony_ci);
191cb0ef41Sopenharmony_ci
201cb0ef41Sopenharmony_ciconst _transform = common.mustCall((chunk, _, next) => {
211cb0ef41Sopenharmony_ci  next();
221cb0ef41Sopenharmony_ci});
231cb0ef41Sopenharmony_ci
241cb0ef41Sopenharmony_ciconst _final = common.mustCall((next) => {
251cb0ef41Sopenharmony_ci  next();
261cb0ef41Sopenharmony_ci});
271cb0ef41Sopenharmony_ci
281cb0ef41Sopenharmony_ciconst _flush = common.mustCall((next) => {
291cb0ef41Sopenharmony_ci  next();
301cb0ef41Sopenharmony_ci});
311cb0ef41Sopenharmony_ci
321cb0ef41Sopenharmony_ciconst t2 = new Transform({
331cb0ef41Sopenharmony_ci  transform: _transform,
341cb0ef41Sopenharmony_ci  flush: _flush,
351cb0ef41Sopenharmony_ci  final: _final
361cb0ef41Sopenharmony_ci});
371cb0ef41Sopenharmony_ci
381cb0ef41Sopenharmony_ciassert.strictEqual(t2._transform, _transform);
391cb0ef41Sopenharmony_ciassert.strictEqual(t2._flush, _flush);
401cb0ef41Sopenharmony_ciassert.strictEqual(t2._final, _final);
411cb0ef41Sopenharmony_ci
421cb0ef41Sopenharmony_cit2.end(Buffer.from('blerg'));
431cb0ef41Sopenharmony_cit2.resume();
44