test: Update stream2 transform for corrected behavior
This commit is contained in:
parent
0118584433
commit
c2f62d496a
@ -140,7 +140,7 @@ test('assymetric transform (expand)', function(t) {
|
|||||||
t.equal(pt.read(5).toString(), 'uelku');
|
t.equal(pt.read(5).toString(), 'uelku');
|
||||||
t.equal(pt.read(5).toString(), 'el');
|
t.equal(pt.read(5).toString(), 'el');
|
||||||
t.end();
|
t.end();
|
||||||
}, 100);
|
}, 200);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('assymetric transform (compress)', function(t) {
|
test('assymetric transform (compress)', function(t) {
|
||||||
@ -223,9 +223,10 @@ test('passthrough event emission', function(t) {
|
|||||||
console.error('need emit 0');
|
console.error('need emit 0');
|
||||||
|
|
||||||
pt.write(new Buffer('bazy'));
|
pt.write(new Buffer('bazy'));
|
||||||
|
console.error('should have emitted, but not again');
|
||||||
pt.write(new Buffer('kuel'));
|
pt.write(new Buffer('kuel'));
|
||||||
|
|
||||||
console.error('should have emitted readable now');
|
console.error('should have emitted readable now 1 === %d', emits);
|
||||||
t.equal(emits, 1);
|
t.equal(emits, 1);
|
||||||
|
|
||||||
t.equal(pt.read(5).toString(), 'arkba');
|
t.equal(pt.read(5).toString(), 'arkba');
|
||||||
@ -263,21 +264,25 @@ test('passthrough event emission reordered', function(t) {
|
|||||||
console.error('need emit 0');
|
console.error('need emit 0');
|
||||||
pt.once('readable', function() {
|
pt.once('readable', function() {
|
||||||
t.equal(pt.read(5).toString(), 'arkba');
|
t.equal(pt.read(5).toString(), 'arkba');
|
||||||
t.equal(pt.read(5).toString(), 'zykue');
|
|
||||||
t.equal(pt.read(5), null);
|
t.equal(pt.read(5), null);
|
||||||
|
|
||||||
console.error('need emit 1');
|
console.error('need emit 1');
|
||||||
pt.once('readable', function() {
|
pt.once('readable', function() {
|
||||||
t.equal(pt.read(5).toString(), 'l');
|
t.equal(pt.read(5).toString(), 'zykue');
|
||||||
t.equal(pt.read(5), null);
|
t.equal(pt.read(5), null);
|
||||||
|
pt.once('readable', function() {
|
||||||
t.equal(emits, 2);
|
t.equal(pt.read(5).toString(), 'l');
|
||||||
t.end();
|
t.equal(pt.read(5), null);
|
||||||
|
t.equal(emits, 3);
|
||||||
|
t.end();
|
||||||
|
});
|
||||||
|
pt.end();
|
||||||
});
|
});
|
||||||
pt.end();
|
pt.write(new Buffer('kuel'));
|
||||||
});
|
});
|
||||||
|
|
||||||
pt.write(new Buffer('bazy'));
|
pt.write(new Buffer('bazy'));
|
||||||
pt.write(new Buffer('kuel'));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('passthrough facaded', function(t) {
|
test('passthrough facaded', function(t) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user