PageRenderTime 17ms CodeModel.GetById 15ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1-3-29/SWIG/Examples/test-suite/lua/newobject1_runme.lua

#
Lua | 16 lines | 12 code | 4 blank | 0 comment | 4 complexity | 507f6a2862338ed289593e4698e2faa9 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1require("import")	-- the import fn
 2import("newobject1")	-- import code
 3
 4foo1 = newobject1.Foo_makeFoo()	-- lua doesnt yet support static fns properly
 5assert(newobject1.Foo_fooCount() == 1)	-- lua doesnt yet support static fns properly
 6
 7foo2 = foo1:makeMore()
 8assert(newobject1.Foo_fooCount() == 2)
 9
10foo1 = nil 
11collectgarbage()
12assert(newobject1.Foo_fooCount() == 1)
13
14foo2 = nil 
15collectgarbage()
16assert(newobject1.Foo_fooCount() == 0)