Skip to content

Commit

Permalink
update tests to stream-spec@0.2 and add inc
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarr committed Jul 11, 2012
1 parent bc00251 commit 5daf23e
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ function pause(stream) {
})
}

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) {

var l = 1000
Expand All @@ -36,7 +53,7 @@ exports['simple'] = function (test) {

spec(t)
.readable()
.strictPausable()
.pausable({strict: true})
.validateOnExit()

read(t, function (err, actual) {
Expand All @@ -58,7 +75,7 @@ exports['simple pausable'] = function (test) {

spec(t)
.readable()
.strictPausable()
.pausable({strict: true})
.validateOnExit()

pause(t)
Expand Down Expand Up @@ -98,7 +115,7 @@ exports['simple (not strictly pausable) setTimeout'] = function (test) {

spec(t)
.readable()
//.strictPausable()
.pausable({strict: false })
.validateOnExit()

//pause(t)
Expand All @@ -120,3 +137,5 @@ exports['simple (not strictly pausable) setTimeout'] = function (test) {
})

}


0 comments on commit 5daf23e

Please sign in to comment.