git ssb

2+

Dominic / pull-stream



Commit af8c7432dbd4a624ff1524436e8efc88b78b827e

update tests

Dominic Tarr committed on 3/22/2013, 3:00:05 PM
Parent: 84124c2098cc684c7adc36f389039be83e46ee20

Files changed

test/read-array.jschanged
test/read-array.jsView
@@ -1,13 +1,17 @@
11 var tape = require('tape')
22
33 var pstrm = require('../')
44
5-var readArray = pstrm.readArray
6-var writeArray = pstrm.writeArray
5+var sources = require('../sources')
6+var sinks = require('../sinks')
77
8-var sourcePipeable = pstrm.sourcePipeable
8+var readArray = sources.readArray
9+var writeArray = sinks.writeArray
10+
11+var pipeableSource = pstrm.pipeableSource
912 var pipeable = pstrm.pipeable
13+var pipeableSink = pstrm.pipeableSink
1014
1115 function arrayReader (read, cb) {
1216 var array = []
1317 read(null, function next (end, data) {
@@ -54,24 +58,26 @@
5458 })
5559
5660 tape('pipe', function (t) {
5761 var array = [1, 2, 3]
58- var read = sourcePipeable(readArray)(array)
62+ var read = pipeableSource(readArray)(array)
5963
6064 t.equal('function', typeof read)
6165 t.equal('function', typeof read.pipe)
6266
63- read.pipe(pipeable(arrayReader)(function (err, _array) {
67+ read.pipe(pipeableSink(arrayReader)(function (err, _array) {
6468 t.equal(err, null)
6569 t.deepEqual(_array, array)
6670 t.end()
6771 }))
6872 })
6973
7074 tape('pipe2', function (t) {
7175 var array = [1, 2, 3]
72- var read = sourcePipeable(readArray)(array)
73- arrayWriter = pipeable(writeArray)
76+ console.log('readArray', readArray)
77+ var read = pipeableSource(readArray)(array)
78+ console.log('reader?', read)
79+ arrayWriter = pipeableSink(writeArray)
7480
7581 t.equal('function', typeof read)
7682 t.equal('function', typeof read.pipe)
7783

Built with git-ssb-web