swig/Examples/test-suite/lua/extend_template_runme.lua

13 lines
390 B
Lua

require("import") -- the import fn
import("extend_template") -- import lib into global
et=extend_template--alias
-- catching undefined variables
local env = _ENV -- Lua 5.2
if not env then env = getfenv () end -- Lua 5.1
setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
foo1 = et.Foo_0()
assert(foo1:test1(5) == 5)
assert(foo1:test2(7) == 7)