git ssb

2+

Dominic / pull-stream



Commit 0cbb0d1109e64ff22c65af5f9e3467d87facc362

test for push buffer

Dominic Tarr committed on 3/22/2013, 11:11:36 PM
Parent: 3557a75dd014797771572f31066099c30f2e4a39

Files changed

test/push-buffer.jsadded
test/push-buffer.jsView
@@ -1,0 +1,27 @@
1+
2+var pull = require('../')
3+var test = require('tape')
4+
5+test('push-buffer', function (t) {
6+
7+ var buf = pull.PushBuffer()
8+
9+ //should be a read function!
10+
11+ t.equal('function', typeof buf)
12+ t.equal(2, buf.length)
13+
14+ buf.pipe(pull.writeArray(function (end, array) {
15+ console.log(array)
16+ t.deepEqual(array, [1, 2, 3])
17+ t.end()
18+ }))
19+
20+ //SOMETIMES YOU NEED PUSH!
21+
22+ buf.push(1)
23+ buf.push(2)
24+ buf.push(3)
25+ buf.end()
26+
27+})

Built with git-ssb-web