lune/tests/roblox/instance/methods/GetFullName.luau

15 lines
527 B
Lua
Raw Normal View History

local fs = require("@lune/fs")
local roblox = require("@lune/roblox")
2023-03-25 16:07:08 +00:00
local modelFile = fs.readFile("tests/roblox/rbx-test-files/models/three-nested-folders/binary.rbxm")
local model = roblox.deserializeModel(modelFile)[1]
2023-03-25 16:07:08 +00:00
local child = model:FindFirstChild("Parent")
assert(child ~= nil)
2023-03-25 16:07:08 +00:00
local descendant = child:FindFirstChild("Child")
assert(descendant ~= nil)
2023-03-25 16:07:08 +00:00
assert(descendant:GetFullName() == "Grandparent.Parent.Child")
assert(child:GetFullName() == "Grandparent.Parent")
assert(model:GetFullName() == "Grandparent")