2023-05-20 13:23:51 +01:00
|
|
|
local fs = require("@lune/fs")
|
2023-05-20 18:49:37 +01:00
|
|
|
local roblox = require("@lune/roblox")
|
2023-03-25 16:07:08 +00:00
|
|
|
local Instance = roblox.Instance
|
|
|
|
|
2023-05-20 13:23:51 +01: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
|
|
|
|
|
|
|
assert(#model:GetDescendants() == 2)
|
|
|
|
|
|
|
|
local newChild = Instance.new("Model")
|
|
|
|
newChild.Parent = model
|
|
|
|
|
|
|
|
assert(#model:GetDescendants() == 3)
|
|
|
|
assert(table.find(model:GetDescendants(), newChild) == 2)
|
|
|
|
|
|
|
|
newChild:Destroy()
|
|
|
|
|
|
|
|
assert(#model:GetDescendants() == 2)
|
|
|
|
assert(table.find(model:GetDescendants(), newChild) == nil)
|