Skip to content

Commit

Permalink
Add failing test case for passing a library name with a platform exte…
Browse files Browse the repository at this point in the history
…nsion.

Thanks @raphaelr!
  • Loading branch information
TooTallNate committed Mar 10, 2012
1 parent 4f7a028 commit d7c7bd1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/library.js
Expand Up @@ -34,6 +34,18 @@ describe('Library', function () {
expect(libm.ceil(1.1)).to.equal(2)
})

it('should accept a lib name with file extension', function() {
var lib = process.platform == 'win32'
? 'msvcrt.dll'
: 'libm' + ffi.PLATFORM_LIBRARY_EXTENSIONS[process.platform]
var libm = new Library(lib, {
'ceil': [ 'double', ['double'] ]
})
var test = libm.ceil instanceof Function
expect(test).to.be(true)
expect(libm.ceil(100.9)).to.equal(101)
})

it('should throw when an invalid function name is used', function () {
expect(function () {
new Library(null, {
Expand Down

0 comments on commit d7c7bd1

Please sign in to comment.