flush.js 365 B

1234567891011121314151617
  1. var binary = require('../');
  2. var test = require('tap').test;
  3. test('flush', function (t) {
  4. t.plan(1);
  5. binary.parse(new Buffer([ 97, 98, 99, 100, 101, 102 ]))
  6. .word8('a')
  7. .word16be('b')
  8. .word16be('c')
  9. .flush()
  10. .word8('d')
  11. .tap(function (vars) {
  12. t.same(vars, { d : 102 });
  13. })
  14. ;
  15. });