]> khamidou — GitHub mirrors - electron.git/commitdiff
spec: Run an example of ffi
authorCheng Zhao <zcbenz@gmail.com>
Thu, 24 Sep 2015 07:08:38 +0000 (15:08 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 24 Sep 2015 07:08:38 +0000 (15:08 +0800)
spec/modules-spec.coffee

index ed2d9fecb435e630e61371cbb13619745cdfc3bb..1cdc6cf0ea5cdebd43fd6e75a7cb8277af990b14 100644 (file)
@@ -24,7 +24,9 @@ describe 'third-party module', ->
 
     describe 'ffi', ->
       it 'does not crash', ->
-        require 'ffi'
+        ffi = require 'ffi'
+        libm = ffi.Library('libm', ceil: [ 'double', [ 'double' ] ])
+        assert.equal libm.ceil(1.5), 2
 
   describe 'q', ->
     Q = require 'q'