From: <wsf...@us...> - 2012-04-24 18:56:22
|
Revision: 13015 http://swig.svn.sourceforge.net/swig/?rev=13015&view=rev Author: wsfulton Date: 2012-04-24 18:56:16 +0000 (Tue, 24 Apr 2012) Log Message: ----------- Add missing Lua factory.i test for patch #3219676 Added Paths: ----------- trunk/Examples/test-suite/lua/li_factory_runme.lua Added: trunk/Examples/test-suite/lua/li_factory_runme.lua =================================================================== --- trunk/Examples/test-suite/lua/li_factory_runme.lua (rev 0) +++ trunk/Examples/test-suite/lua/li_factory_runme.lua 2012-04-24 18:56:16 UTC (rev 13015) @@ -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) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |