PageRenderTime 45ms CodeModel.GetById 20ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. require("import") -- the import fn
  2. import("newobject2",true) -- import code
  3. foo1 = newobject2.makeFoo() -- lua doesnt yet support static fns properly
  4. assert(newobject2.fooCount() == 1) -- lua doesnt yet support static fns properly
  5. foo2 = newobject2.makeFoo()
  6. assert(newobject2.fooCount() == 2)
  7. foo1 = nil
  8. collectgarbage()
  9. assert(newobject2.fooCount() == 1)
  10. foo2 = nil
  11. collectgarbage()
  12. assert(newobject2.fooCount() == 0)