ws-roblox: model/robloxmesh (.mesh 1.00-5.00, 6.00/7.00 chunked with raw COREMESH read; Draco COREMESH UNSUPPORTED; 2.00 / 4.00 write with skinning subsets and LODs) mapped to Scene; rbxm / rbxmx variant() for F.detect (rbxl / rbxlx); api tests
This commit is contained in:
1 parent
ecf361116c
commit
225a9b081e
11 files changed
+1886
No files matched your search
@@ -240,6 +240,23 @@ do
|
||||
t:check(e8 and e8.code == Err.CORRUPT, "a cycle: " .. tostring(e8))
|
||||
end
|
||||
|
||||
-- through the api: detection (variant: rbxl for places), load, save, convert
|
||||
do
|
||||
local F = require("@formats")
|
||||
t:eq(F.detect(file("place.rbxl").data), "rbxl", "detect a place")
|
||||
t:eq(F.detect(file("model.rbxm").data), "rbxm", "detect a model")
|
||||
t:eq(F.detect(file("place.rbxlx").data), "rbxlx", "detect an XML place")
|
||||
t:eq(F.detect(file("model.rbxmx").data), "rbxmx", "detect an XML model")
|
||||
local tree = F.load(file("model.rbxm").data)
|
||||
t:check(tree and tree.kind == "rbxtree", "F.load")
|
||||
local again = F.save(tree)
|
||||
t:check(type(again) == "buffer" and Rbxm.sniff(Bytes.reader(again)) == 1, "F.save keeps the source format")
|
||||
local x = F.convert(file("model.rbxm").data, "rbxmx")
|
||||
t:check(type(x) == "buffer" and Rbxmx.sniff(Bytes.reader(x)) == 1, "F.convert to rbxmx")
|
||||
local l = F.save(tree, nil, { format = "rbxl" })
|
||||
t:eq(F.detect(l), "rbxl", "save as rbxl marks services")
|
||||
end
|
||||
|
||||
-- fuzz
|
||||
do
|
||||
local samples = { file("model-raw.rbxm").data, Rbxm.encode(H.everything(), { compression = "none" }) :: buffer, Rbxm.encode(H.everything()) :: buffer }
|
||||
|
||||
Reference in new issue
Block a user