Skip to content

Commit

Permalink
Assert that block is properly sliced.
Browse files Browse the repository at this point in the history
Closes #8.
  • Loading branch information
flatheadmill committed Feb 15, 2014
1 parent bfc4f0e commit 7cd8630
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions release.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ buffering are provided by `stream.Readable`.

### Issue by Issue

* Assert that block is properly sliced #8.
* Implement basic block reading interface. #7.
5 changes: 3 additions & 2 deletions t/blocker/block.t.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
require('proof')(1, function (equal) {
require('proof')(2, function (equal) {
var Blocker = require('../..')
var stream = require('stream')
var pipe = new stream.PassThrough
var blocker = new Blocker(pipe)

var buffer = new Buffer(2)
var buffer = new Buffer(16)
buffer.writeUInt16BE(0xaaaa, 0)

pipe.write(buffer.slice(0, 1))

blocker.block(2, function (buffer) {
equal(buffer.length, 2, 'sliced')
equal(buffer.readUInt16BE(0), 0xaaaa, 'block is ready')
})

Expand Down

0 comments on commit 7cd8630

Please sign in to comment.