Initial revision of animqueue

This commit is contained in:
2021-01-12 14:14:38 -05:00
parent 78f8610eb8
commit 25b9b4cb5d
18 changed files with 785 additions and 308 deletions

View File

@@ -2,6 +2,7 @@
local ut = {}
function ut.globaldb()
globaldb.enable()
local g1a = global("unittest-g1")
local g2a = global("unittest-g2")
local g1b = global("unittest-g1")

View File

@@ -7,25 +7,12 @@ function ut.table_count()
assert(table.count({[2]=5,[5]=3}) == 2)
end
function ut.table_coerce()
local t = {}
local t1 = table.coerce(t)
assert(t1==t)
t1 = table.coerce(0)
assert(type(t1) == "table")
t1 = table.coerce(nil)
assert(type(t1) == "table")
end
function ut.table_clear()
local t = { a = 1, b = 2 }
table.clear(t)
assert(t.a == nil)
assert(t.b == nil)
assert(table.count(t) == 0)
setmetatable(t, t)
table.clear(t)
assert(getmetatable(t) == nil)
end
function ut.table_empty()
@@ -46,13 +33,13 @@ function ut.table_equal()
assert(not table.equal({a=1,b=3},{a=1,b=2}))
end
function ut.table_append()
function ut.table_push()
t = {}
table.append(t, 1)
table.push(t, 1)
assert(table.equal(t, {1}))
table.append(t, 2)
table.push(t, 2)
assert(table.equal(t, {1,2}))
table.append(t, 3)
table.push(t, 3)
assert(table.equal(t, {1,2,3}))
end