Add missing Lua factory.i test for patch #3219676
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13015 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
dc7818db81
commit
1bc105bd72
1 changed files with 16 additions and 0 deletions
16
Examples/test-suite/lua/li_factory_runme.lua
Normal file
16
Examples/test-suite/lua/li_factory_runme.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
require("import") -- the import fn
|
||||
import("li_factory") -- import code
|
||||
|
||||
-- moving to global
|
||||
for k,v in pairs(li_factory) do _G[k]=v end
|
||||
|
||||
-- catch "undefined" global variables
|
||||
setmetatable(getfenv(),{__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
|
||||
|
||||
circle = Geometry_create(Geometry_CIRCLE)
|
||||
r = circle:radius()
|
||||
assert(r == 1.5)
|
||||
|
||||
point = Geometry_create(Geometry_POINT)
|
||||
w = point:width()
|
||||
assert(w == 1.0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue