Files: 0cbb0d1109e64ff22c65af5f9e3467d87facc362 / test / push-buffer.js
429 bytesRaw
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 | }) |
28 |
Built with git-ssb-web