Commit af8c7432dbd4a624ff1524436e8efc88b78b827e
update tests
Dominic Tarr committed on 3/22/2013, 3:00:05 PMParent: 84124c2098cc684c7adc36f389039be83e46ee20
Files changed
test/read-array.js | changed |
test/read-array.js | ||
---|---|---|
@@ -1,13 +1,17 @@ | ||
1 | 1 | var tape = require('tape') |
2 | 2 | |
3 | 3 | var pstrm = require('../') |
4 | 4 | |
5 | -var readArray = pstrm.readArray | |
6 | -var writeArray = pstrm.writeArray | |
5 | +var sources = require('../sources') | |
6 | +var sinks = require('../sinks') | |
7 | 7 | |
8 | -var sourcePipeable = pstrm.sourcePipeable | |
8 | +var readArray = sources.readArray | |
9 | +var writeArray = sinks.writeArray | |
10 | + | |
11 | +var pipeableSource = pstrm.pipeableSource | |
9 | 12 | var pipeable = pstrm.pipeable |
13 | +var pipeableSink = pstrm.pipeableSink | |
10 | 14 | |
11 | 15 | function arrayReader (read, cb) { |
12 | 16 | var array = [] |
13 | 17 | read(null, function next (end, data) { |
@@ -54,24 +58,26 @@ | ||
54 | 58 | }) |
55 | 59 | |
56 | 60 | tape('pipe', function (t) { |
57 | 61 | var array = [1, 2, 3] |
58 | - var read = sourcePipeable(readArray)(array) | |
62 | + var read = pipeableSource(readArray)(array) | |
59 | 63 | |
60 | 64 | t.equal('function', typeof read) |
61 | 65 | t.equal('function', typeof read.pipe) |
62 | 66 | |
63 | - read.pipe(pipeable(arrayReader)(function (err, _array) { | |
67 | + read.pipe(pipeableSink(arrayReader)(function (err, _array) { | |
64 | 68 | t.equal(err, null) |
65 | 69 | t.deepEqual(_array, array) |
66 | 70 | t.end() |
67 | 71 | })) |
68 | 72 | }) |
69 | 73 | |
70 | 74 | tape('pipe2', function (t) { |
71 | 75 | 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) | |
74 | 80 | |
75 | 81 | t.equal('function', typeof read) |
76 | 82 | t.equal('function', typeof read.pipe) |
77 | 83 |
Built with git-ssb-web