eris: disable unit test of __persist metamethod
This commit is contained in:
@@ -137,19 +137,23 @@ rootobj.testuvcycle = uvcycle
|
|||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
-- Special callback for persisting tables.
|
-- Special callback for persisting tables.
|
||||||
|
--
|
||||||
|
-- Note: the __persist metamethod was deliberately disabled in the
|
||||||
|
-- luprex version of eris. Therefore this unit test was also disabled.
|
||||||
|
--
|
||||||
|
|
||||||
local sptable = { a = 3 }
|
-- local sptable = { a = 3 }
|
||||||
|
--
|
||||||
setmetatable(sptable, {
|
-- setmetatable(sptable, {
|
||||||
__persist = function(tbl)
|
-- __persist = function(tbl)
|
||||||
local a = tbl.a
|
-- local a = tbl.a
|
||||||
return function()
|
-- return function()
|
||||||
return { a = a+3 }
|
-- return { a = a+3 }
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
})
|
-- })
|
||||||
|
--
|
||||||
rootobj.testsptable = sptable
|
-- rootobj.testsptable = sptable
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
-- Special callbacks for persisting userdata.
|
-- Special callbacks for persisting userdata.
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ function test(rootobj)
|
|||||||
dotest("Nil in closure ", rootobj.testnilclosure() == nil)
|
dotest("Nil in closure ", rootobj.testnilclosure() == nil)
|
||||||
dotest("Nested func ", rootobj.testnest(1) == 6)
|
dotest("Nested func ", rootobj.testnest(1) == 6)
|
||||||
dotest("Upvalue cycles ", rootobj.testuvcycle()[1] == rootobj.testuvcycle()[2])
|
dotest("Upvalue cycles ", rootobj.testuvcycle()[1] == rootobj.testuvcycle()[2])
|
||||||
dotest("Table special persist ", rootobj.testsptable.a == 6)
|
|
||||||
dotest("Udata special persist ", unboxboolean(rootobj.testspudata1) == true and unboxboolean(rootobj.testspudata2) == false)
|
dotest("Udata special persist ", unboxboolean(rootobj.testspudata1) == true and unboxboolean(rootobj.testspudata2) == false)
|
||||||
dotest("Identical tables ", rootobj.testsharedrefa ~= rootobj.testsharedrefb)
|
dotest("Identical tables ", rootobj.testsharedrefa ~= rootobj.testsharedrefb)
|
||||||
dotest("Shared reference ", rootobj.testsharedrefa.sharedref == rootobj.testsharedrefb.sharedref)
|
dotest("Shared reference ", rootobj.testsharedrefa.sharedref == rootobj.testsharedrefb.sharedref)
|
||||||
@@ -59,6 +58,12 @@ function test(rootobj)
|
|||||||
dotest("Deep callstack ", rootobj.testdeep() == 100)
|
dotest("Deep callstack ", rootobj.testdeep() == 100)
|
||||||
dotest("Tail call ", rootobj.testtail() == 100)
|
dotest("Tail call ", rootobj.testtail() == 100)
|
||||||
|
|
||||||
|
|
||||||
|
-- Note: the following test uses the persist metamethod, which
|
||||||
|
-- was deliberately disabled in the luprex version of eris.
|
||||||
|
-- dotest("Table special persist ", rootobj.testsptable.a == 6)
|
||||||
|
|
||||||
|
|
||||||
print()
|
print()
|
||||||
if passed == total then
|
if passed == total then
|
||||||
print("All tests passed.")
|
print("All tests passed.")
|
||||||
|
|||||||
Reference in New Issue
Block a user