mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
parent
d1f86a3f9e
commit
32fa44f4c5
3 changed files with 47 additions and 4 deletions
|
|
@ -691,6 +691,7 @@ TEST("effect()", wrap_root(function()
|
|||
end))
|
||||
|
||||
TEST("cleanup()", wrap_root(function()
|
||||
local root = vide.root
|
||||
local source = vide.source
|
||||
local effect = vide.effect
|
||||
local cleanup = vide.cleanup
|
||||
|
|
@ -749,6 +750,25 @@ TEST("cleanup()", wrap_root(function()
|
|||
src(3)
|
||||
CHECK(testkit.seq(queue, { 1, 2, 1, 2 }))
|
||||
end
|
||||
|
||||
do CASE "cleanup objects"
|
||||
local ran = {}
|
||||
|
||||
root(function(destroy)
|
||||
effect(function()
|
||||
cleanup { disconnect = function() ran.disconnect = true end }
|
||||
cleanup { Disconnect = function() ran.Disconnect = true end }
|
||||
cleanup { destroy = function() ran.destroy = true end }
|
||||
cleanup { Destroy = function() ran.Destroy = true end }
|
||||
destroy()
|
||||
end)
|
||||
end)
|
||||
|
||||
CHECK(ran.disconnect)
|
||||
CHECK(ran.Disconnect)
|
||||
CHECK(ran.destroy)
|
||||
CHECK(ran.Destroy)
|
||||
end
|
||||
end))
|
||||
|
||||
TEST("create()", wrap_root(function()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue