Stub out the new global.set and global.get operators

This commit is contained in:
2023-03-01 17:35:06 -05:00
parent 9ce34d950b
commit db234c2934
6 changed files with 115 additions and 88 deletions

View File

@@ -4,7 +4,6 @@
#
ut-table.lua
ut-globaldb.lua
ut-tablecmp.lua
basics.lua
uglyglobals.lua

View File

@@ -1,13 +0,0 @@
makeclass("unittests")
function unittests.globaldb()
local g1a = global.table("unittest-g1")
local g2a = global.table("unittest-g2")
local g1b = global.table("unittest-g1")
local g2b = global.table("unittest-g2")
assert(g1a == g1b)
assert(g2a == g2b)
assert(g1a.__global == "unittest-g1")
assert(g2a.__global == "unittest-g2")
end

View File

@@ -51,11 +51,6 @@ function unittests.diffcompare()
-- Try a table containing a pointer to the global environment.
assert(tdc({}, {a=_G}, {}, {}) == "a=globals;")
-- GlobalDB tables should be forced to NIL.
assert(tdc({}, {a=global.table("foo")}, {}, {a=global.table("foo")}) == "a=nil;");
assert(tdc({}, {}, {}, {a=global.table("foo")}) == "a=nil;");
assert(tdc({}, {a=global.table("foo")}, {}, {}) == "");
-- Set up some numbered tables for tests involving such.
local mtab10 = {}
local stab10 = {}
@@ -116,11 +111,6 @@ function unittests.diffapply()
-- verify a table containing the global environment.
assert(tda(tnmap, {a=_G}, {}))
-- GlobalDB tables should be forced to NIL.
rtab={a=3}
assert(not tda({}, {a=global.table("foo")}, rtab))
assert(rtab.a == nil)
-- Unnumbered tables should be forced to NIL.
rtab={a=3}
assert(not tda({}, {a={}}, rtab))