PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/lua/newobject2_runme.lua

#
Lua | 16 lines | 12 code | 4 blank | 0 comment | 4 complexity | 9c2acae45b19f2ddead30e7ba796a7b5 MD5 | raw file
 1require("import")	-- the import fn
 2import("newobject2",true)	-- import code
 3
 4foo1 = newobject2.makeFoo()	-- lua doesnt yet support static fns properly
 5assert(newobject2.fooCount() == 1)	-- lua doesnt yet support static fns properly
 6
 7foo2 = newobject2.makeFoo()
 8assert(newobject2.fooCount() == 2)
 9
10foo1 = nil 
11collectgarbage()
12assert(newobject2.fooCount() == 1)
13
14foo2 = nil 
15collectgarbage()
16assert(newobject2.fooCount() == 0)