var Transform = require('stream').Transform

  , test = require('tape')
  , bufferedTransform = require('./stream')

test('stream with one chunk and one data block', function (t) {
  t.plan(2)

  var stream = new Transform()

  stream._transform = bufferedTransform(
    function (chunk, enc, callback) {
      this.push(chunk)
      callback()
    }
  )

  stream.on('data', function (chunk) {
    t.deepEqual(chunk, new Buffer([ 1, 2, 3, 4, 5 ]))
  })

  stream.once('end', function () {
    t.pass('should emit end')
    t.end()
  })

  stream.write(new Buffer([ 5, 0, 0, 0, 1, 2, 3, 4, 5 ]))
  stream.end()
})

test('stream with 1 byte chunks', function (t) {
  t.end()
})

test('stream with chunks of different lengths', function (t) {
  t.end()
})

test('stream with one chunk with multiple data blocks', function (t) {
  t.end()
})
@@ -108,16 +108,245 @@
 stream')
+%0A  , collectData = function (stream, callback) %7B%0A      var data = %5B%5D%0A%0A      stream.on('data', function (chunk) %7B%0A        data.push(chunk)%0A      %7D)%0A      stream.once('end', function () %7B%0A        callback(null, data)%0A      %7D)%0A    %7D
 %0A%0Atest('
@@ -407,21 +407,8 @@
 ) %7B%0A
-  t.plan(2)%0A%0A
   va
@@ -571,44 +571,104 @@
 %0A%0A  
-stream.on('data', function (chunk) %7B
+collectData(stream, function (err, data) %7B%0A    t.equal(data.length, 1, 'correct chunks emitted')
 %0A   
@@ -680,21 +680,23 @@
 epEqual(
-chunk
+data%5B0%5D
 , new Bu
@@ -724,79 +724,8 @@
 %5D))%0A
-  %7D)%0A%0A  stream.once('end', function () %7B%0A    t.pass('should emit end')%0A
     

simplify test