Permalink
Browse files

add another type coersion test

  • Loading branch information...
TooTallNate committed May 17, 2012
1 parent 0099c89 commit 7246c2b106ba82eacd128db63144a6fda4f6a456
Showing with 9 additions and 0 deletions.
  1. +9 −0 test/coerce.js
View
@@ -11,7 +11,16 @@ describe('coerce', function () {
it('should return a ref type when a "*" is present', function () {
var type = ref.coerceType('void *')
+ assert(type !== ref.types.void)
assert.equal(type.indirection, ref.types.void.indirection + 1)
})
+ it('should coerce the "type" property of a Buffer', function () {
+ var buf = new Buffer(ref.sizeof.int)
+ buf.type = 'int'
+ var type = ref.getType(buf)
+ assert.strictEqual(ref.types.int, type)
+ assert.strictEqual('int', buf.type)
+ })
+
})

0 comments on commit 7246c2b

Please sign in to comment.