mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
587 B
32 lines
587 B
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
const Transform = require('stream').Transform;
|
|
|
|
let _transformCalled = false;
|
|
function _transform(d, e, n) {
|
|
_transformCalled = true;
|
|
n();
|
|
}
|
|
|
|
let _flushCalled = false;
|
|
function _flush(n) {
|
|
_flushCalled = true;
|
|
n();
|
|
}
|
|
|
|
const t = new Transform({
|
|
transform: _transform,
|
|
flush: _flush
|
|
});
|
|
|
|
t.end(Buffer.from('blerg'));
|
|
t.resume();
|
|
|
|
process.on('exit', function() {
|
|
assert.strictEqual(t._transform, _transform);
|
|
assert.strictEqual(t._flush, _flush);
|
|
assert(_transformCalled);
|
|
assert(_flushCalled);
|
|
});
|
|
|