PageRenderTime 26ms CodeModel.GetById 20ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

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

#
Lua | 16 lines | 12 code | 4 blank | 0 comment | 4 complexity | 507f6a2862338ed289593e4698e2faa9 MD5 | raw file
 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)