mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
allow fragments in implicit effects for children (#29)
* fix fragments in effects * add test case * more descriptive test
This commit is contained in:
parent
72e5fbb6fe
commit
b85419088c
3 changed files with 49 additions and 3 deletions
|
|
@ -945,6 +945,42 @@ TEST("create()", wrap_root(function()
|
|||
CHECK((f2 :: any).a == 2)
|
||||
end
|
||||
|
||||
do CASE "nested children effect"
|
||||
local a = create "Frame" { Name = "a" }
|
||||
local b = create "Frame" { Name = "b" }
|
||||
local c = create "Frame" { Name = "c" }
|
||||
local d = create "Frame" { Name = "d" }
|
||||
local e = create "Frame" { Name = "e" }
|
||||
|
||||
local children = source {
|
||||
a,
|
||||
{ b, c, { d } },
|
||||
{ { e } }
|
||||
}
|
||||
|
||||
local obj = create "Frame" {
|
||||
children
|
||||
}
|
||||
|
||||
CHECK(obj:FindFirstChild("a"))
|
||||
CHECK(obj:FindFirstChild("b"))
|
||||
CHECK(obj:FindFirstChild("c"))
|
||||
CHECK(obj:FindFirstChild("d"))
|
||||
CHECK(obj:FindFirstChild("e"))
|
||||
|
||||
children {
|
||||
b,
|
||||
{ c, a },
|
||||
{ { d } }
|
||||
}
|
||||
|
||||
CHECK(obj:FindFirstChild("a"))
|
||||
CHECK(obj:FindFirstChild("b"))
|
||||
CHECK(obj:FindFirstChild("c"))
|
||||
CHECK(obj:FindFirstChild("d"))
|
||||
CHECK(not obj:FindFirstChild("e"))
|
||||
end
|
||||
|
||||
do CASE "garbage collection test"
|
||||
local wref
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue