summaryrefslogtreecommitdiff
path: root/Examples/test-suite/lua/newobject1_runme.lua
blob: 5de8276db340e8ef23d2e8e6aeb7293f4c9ed928 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require("import")	-- the import fn
import("newobject1")	-- import code

foo1 = newobject1.Foo_makeFoo()	-- lua doesnt yet support static fns properly
assert(newobject1.Foo_fooCount() == 1)	-- lua doesnt yet support static fns properly

foo2 = foo1:makeMore()
assert(newobject1.Foo_fooCount() == 2)

foo1 = nil 
collectgarbage()
assert(newobject1.Foo_fooCount() == 1)

foo2 = nil 
collectgarbage()
assert(newobject1.Foo_fooCount() == 0)