Browse files

Add failing test case for passing a library name with a platform exte…

…nsion.

Thanks @raphaelr!
  • Loading branch information...
1 parent 4f7a028 commit d7c7bd1c05e688145c396e0cbefc3b39846858bf @TooTallNate TooTallNate committed Mar 10, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 test/library.js
View
12 test/library.js
@@ -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, {

0 comments on commit d7c7bd1

Please sign in to comment.