alloc.js 393 B

1234567891011121314151617
  1. var assert = require('assert')
  2. var ref = require('../')
  3. describe('alloc()', function () {
  4. it('should return a new Buffer of "bool" size', function () {
  5. var buf = ref.alloc(ref.types.bool)
  6. assert.equal(ref.sizeof.bool, buf.length)
  7. })
  8. it('should coerce string type names', function () {
  9. var buf = ref.alloc('bool')
  10. assert.strictEqual(ref.types.bool, buf.type)
  11. })
  12. })