mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Add implicit effects recursively creating more implicit effects for children
This commit is contained in:
parent
4c639f8388
commit
b44b9ef2ba
6 changed files with 170 additions and 112 deletions
|
|
@ -996,6 +996,48 @@ TEST("create()", wrap_root(function()
|
|||
CHECK(not obj:FindFirstChild("e"))
|
||||
end
|
||||
|
||||
do CASE "nested children source effect"
|
||||
local a = create "Frame" { Name = "a" } :: Instance
|
||||
local b = create "Frame" { Name = "b" } :: Instance
|
||||
local c = create "Frame" { Name = "c" } :: Instance
|
||||
|
||||
local nested_children = source { b, c }
|
||||
local children = source { a :: Instance | () -> { Instance }, nested_children }
|
||||
|
||||
local parent = create "Frame" {
|
||||
Name = "parent",
|
||||
children
|
||||
}
|
||||
|
||||
CHECK(parent:FindFirstChild "a")
|
||||
CHECK(parent:FindFirstChild "b")
|
||||
CHECK(parent:FindFirstChild "c")
|
||||
nested_children {}
|
||||
CHECK(parent:FindFirstChild "a")
|
||||
CHECK(not parent:FindFirstChild "b")
|
||||
CHECK(not parent:FindFirstChild "c")
|
||||
nested_children { b }
|
||||
CHECK(parent:FindFirstChild "a")
|
||||
CHECK(parent:FindFirstChild "b")
|
||||
CHECK(not parent:FindFirstChild "c")
|
||||
children { a }
|
||||
CHECK(parent:FindFirstChild "a")
|
||||
CHECK(not parent:FindFirstChild "b")
|
||||
CHECK(not parent:FindFirstChild "c")
|
||||
nested_children { b, c }
|
||||
CHECK(parent:FindFirstChild "a")
|
||||
CHECK(not parent:FindFirstChild "b")
|
||||
CHECK(not parent:FindFirstChild "c")
|
||||
children { a :: Instance | () -> { Instance }, nested_children }
|
||||
CHECK(parent:FindFirstChild "a")
|
||||
CHECK(parent:FindFirstChild "b")
|
||||
CHECK(parent:FindFirstChild "c")
|
||||
nested_children { c }
|
||||
CHECK(parent:FindFirstChild "a")
|
||||
CHECK(not parent:FindFirstChild "b")
|
||||
CHECK(parent:FindFirstChild "c")
|
||||
end
|
||||
|
||||
do CASE "garbage collection test"
|
||||
local wref
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue