lune/tests/roblox/files/deserializeModel.luau
2023-05-20 19:49:37 +02:00

23 lines
691 B
Text

local fs = require("@lune/fs")
local roblox = require("@lune/roblox")
local modelDirs = {}
for _, dirName in fs.readDir("tests/roblox/rbx-test-files/places") do
table.insert(modelDirs, "tests/roblox/rbx-test-files/places/" .. dirName)
end
for _, modelDir in modelDirs do
local modelFileBinary = fs.readFile(modelDir .. "/binary.rbxl")
local modelFileXml = fs.readFile(modelDir .. "/xml.rbxlx")
local modelBinary = roblox.deserializeModel(modelFileBinary)
local modelXml = roblox.deserializeModel(modelFileXml)
for _, modelInstance in modelBinary do
assert(modelInstance:IsA("Instance"))
end
for _, modelInstance in modelXml do
assert(modelInstance:IsA("Instance"))
end
end