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

21 lines
698 B
Text

local fs = require("@lune/fs")
local roblox = require("@lune/roblox")
local placeDirs = {}
for _, dirName in fs.readDir("tests/roblox/rbx-test-files/places") do
table.insert(placeDirs, "tests/roblox/rbx-test-files/places/" .. dirName)
end
for _, placeDir in placeDirs do
local placeFileBinary = fs.readFile(placeDir .. "/binary.rbxl")
local placeFileXml = fs.readFile(placeDir .. "/xml.rbxlx")
local placeBinary = roblox.deserializePlace(placeFileBinary)
local placeXml = roblox.deserializePlace(placeFileXml)
assert(placeBinary.ClassName == "DataModel")
assert(placeXml.ClassName == "DataModel")
assert(placeBinary:IsA("ServiceProvider"))
assert(placeXml:IsA("ServiceProvider"))
end