blob: 7be673c517b30bd22190e256aeb0ef373873ff59 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
'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.equal(t._transform, _transform);
assert.equal(t._flush, _flush);
assert(_transformCalled);
assert(_flushCalled);
});
|