All files / simple-buffer-queue/tests index.js

100% Statements 9/9
100% Branches 0/0
100% Functions 1/1
100% Lines 9/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 152x 2x   2x 2x 2x   2x   2x   2x 2x    
const tape = require('tape')
const Pipe = require('../')
 
tape('tests', t => {
  const p = new Pipe(Buffer.from([1, 2, 3, 4]))
  p.write(Buffer.from([99]))
 
  t.deepEquals(p.buffer, Buffer.from([1, 2, 3, 4, 99]))
 
  const buf = p.read(3)
 
  t.deepEquals(buf, Buffer.from([1, 2, 3]))
  t.end()
})