1
1
Fork 0
mirror of https://github.com/lune-org/lune.git synced 2025-04-21 12:24:03 +01:00
lune/tests/roblox/instance/methods/IsDescendantOf.luau
2023-05-20 19:49:37 +02:00

21 lines
607 B
Text

local roblox = require("@lune/roblox")
local Instance = roblox.Instance
local root = Instance.new("Folder")
local child = Instance.new("Model")
local descendant = Instance.new("Part")
child.Parent = root
descendant.Parent = child
assert(not root:IsDescendantOf(root))
assert(child:IsDescendantOf(root))
assert(descendant:IsDescendantOf(root))
assert(not root:IsDescendantOf(child))
assert(not child:IsDescendantOf(child))
assert(descendant:IsDescendantOf(child))
assert(not root:IsDescendantOf(descendant))
assert(not child:IsDescendantOf(descendant))
assert(not descendant:IsDescendantOf(descendant))