Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add test cases for `ref.alloc()`

  • Loading branch information...
commit 0099c89d3647abc3f7b2089d22e70aeddcba5729 1 parent 675753c
@TooTallNate authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 test/alloc.js
View
17 test/alloc.js
@@ -0,0 +1,17 @@
+
+var assert = require('assert')
+var ref = require('../')
+
+describe('alloc()', function () {
+
+ it('should return a new Buffer of "bool" size', function () {
+ var buf = ref.alloc(ref.types.bool)
+ assert.equal(ref.sizeof.bool, buf.length)
+ })
+
+ it('should coerce string type names', function () {
+ var buf = ref.alloc('bool')
+ assert.strictEqual(ref.types.bool, buf.type)
+ })
+
+})
Please sign in to comment.
Something went wrong with that request. Please try again.