summaryrefslogtreecommitdiff
path: root/trunk/Examples/test-suite/lua/newobject1_runme.lua
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/Examples/test-suite/lua/newobject1_runme.lua')
-rw-r--r--trunk/Examples/test-suite/lua/newobject1_runme.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/trunk/Examples/test-suite/lua/newobject1_runme.lua b/trunk/Examples/test-suite/lua/newobject1_runme.lua
new file mode 100644
index 000000000..5de8276db
--- /dev/null
+++ b/trunk/Examples/test-suite/lua/newobject1_runme.lua
@@ -0,0 +1,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)