Permalink
Browse files

test: add a basic test testing `ref.refType()` functionality

  • Loading branch information...
1 parent 9c5cabf commit b52080eb7b69c799e9fa50295e50b611dbf801b0 @TooTallNate committed May 31, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 test/types.js
View
@@ -6,6 +6,13 @@ describe('types', function () {
describe('refType()', function () {
+ it('should return a new "type" with its `indirection` level increased by 1', function () {
+ var int = ref.types.int
+ var intPtr = ref.refType(int)
+ assert.equal(int.size, intPtr.size)
+ assert.equal(int.indirection + 1, intPtr.indirection)
+ })
+
it('should coerce string types', function () {
var intPtr = ref.refType('int')
assert.equal(2, intPtr.indirection)

0 comments on commit b52080e

Please sign in to comment.