tests/data: comments: specs only
This commit is contained in:
1 parent
653ce4e002
commit
7672980c65
12 files changed
+16
-63
No files matched your search
+1
-6
@@ -1,7 +1,4 @@
|
||||
-- data/nbt tests: the contract, nbtlib files through the api (F.load / F.save, NBT -> SNBT -> NBT), detection by
|
||||
-- content and extension, exact round trips (root name, edition, compression and the Bedrock header kept), error
|
||||
-- codes, and the fuzz pass. The engine itself: tests/codecs/nbt.luau; SNBT files: tests/data/snbt.luau.
|
||||
-- Fixtures: tools/fixtures/nbt.py.
|
||||
-- data/nbt format tests (the engine: tests/codecs/nbt.luau) against nbtlib (tools/fixtures/nbt.py).
|
||||
local T = require("@tests/T")
|
||||
local F = require("@rosetta")
|
||||
local NbtF = require("@rosetta/data/nbt")
|
||||
@@ -34,14 +31,12 @@ for i = 1, 12 do
|
||||
t:eq(buffer.tostring(assert(F.save(le, nil, { format = "nbt" })) :: buffer), c.header, c.name .. ": Bedrock level.dat same bytes")
|
||||
end
|
||||
|
||||
-- detection
|
||||
do
|
||||
local c = Fx.cases[3]
|
||||
t:eq(F.detect(c.gzip, { name = "level.dat" }), "nbt", "detect gzip .dat")
|
||||
t:eq(F.detect(c.raw, { name = "x.nbt" }), "nbt", "detect raw .nbt")
|
||||
end
|
||||
|
||||
-- errors
|
||||
do
|
||||
local _, e = NbtF.decode(Bytes.reader(buffer.fromstring("\10\0\0\1")))
|
||||
t:check(e and e.code == Err.TRUNCATED, "truncated")
|
||||
|
||||
Reference in new issue
Block a user