Comparing version 0.0.1 to 0.0.2
@@ -32,3 +32,3 @@ | ||
if(ended) return | ||
while(!ended && !s.paused && source.call(s, i, function () { | ||
while(!ended && !s.paused && source.call(s, i++, function () { | ||
if(!n++ && !s.ended && !s.paused) | ||
@@ -35,0 +35,0 @@ next() |
{ | ||
"name": "from", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Easy way to make a Readable Stream", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -28,2 +28,19 @@ var from = require('..') | ||
exports['inc'] = function (test) { | ||
var fs = from(function (i) { | ||
this.emit('data', i) | ||
if(i >= 99) | ||
return this.emit('end') | ||
return true | ||
}) | ||
spec(fs).readable().validateOnExit() | ||
read(fs, function (err, arr) { | ||
test.equal(arr.length, 100) | ||
test.done() | ||
}) | ||
} | ||
exports['simple'] = function (test) { | ||
@@ -40,3 +57,3 @@ | ||
.readable() | ||
.strictPausable() | ||
.pausable({strict: true}) | ||
.validateOnExit() | ||
@@ -63,3 +80,3 @@ | ||
.readable() | ||
.strictPausable() | ||
.pausable({strict: true}) | ||
.validateOnExit() | ||
@@ -104,3 +121,3 @@ | ||
.readable() | ||
//.strictPausable() | ||
.pausable({strict: false }) | ||
.validateOnExit() | ||
@@ -127,1 +144,3 @@ | ||
} | ||
6194
166