Add a print for the luajit version to simple-test.
This was added to easily verify that hslua was compiled against luajit.
module Main where
+import Control.Monad
import qualified Foreign.Lua as Lua
main :: IO ()
@@ -12,4 +13,10 @@ main = do
Lua.pushstring l "Hello from"
Lua.getglobal l "_VERSION"
Lua.call l 2 0
+ Lua.getglobal l "jit"
+ isLuajit <- Lua.istable l (-1)
+ when isLuajit $ do
+ Lua.getglobal l "print"
+ Lua.getfield l (-2) "version"
+ Lua.call l 1 0
Lua.close l
