allow fragments in implicit effects for children (#29)

* fix fragments in effects

* add test case

* more descriptive test
This commit is contained in:
alicesaidhi 2024-08-20 13:40:29 +02:00 committed by GitHub
parent 72e5fbb6fe
commit b85419088c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 49 additions and 3 deletions

View file

@ -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