Skip to content

Commit

Permalink
add another type coersion test
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed May 17, 2012
1 parent 0099c89 commit 7246c2b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/coerce.js
Expand Up @@ -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.