tests/codecs (m-z): comments: specs only
This commit is contained in:
1 parent
98b4ce533e
commit
a6732d45f2
23 files changed
+46
-177
No files matched your search
@@ -1,7 +1,5 @@
|
||||
-- codecs/compress/Zstd tests: every fixture case (the zstd CLI at levels 1..19, --ultra -22, --fast, --long, small windows,
|
||||
-- with / without checksum and content size, multi-frame and skippable frames, empty input) decodes to its corpus;
|
||||
-- offsets / consumedEnd; XXH64 vectors; checksum, limit and error codes; truncated / corrupted / random input never
|
||||
-- throws. Fixtures: tools/fixtures/zstd.py.
|
||||
-- codecs/compress/Zstd tests: zstd CLI frames (levels 1..19, --ultra -22, --fast, --long) decode, XXH64, errors.
|
||||
-- Fixtures: tools/fixtures/zstd.py.
|
||||
local T = require("@tests/T")
|
||||
local Zstd = require("@rosetta/codecs/compress/Zstd")
|
||||
local Err = require("@rosetta/core/Err")
|
||||
@@ -22,7 +20,6 @@ do
|
||||
t:eq(hex(string.rep("0123456789", 10)), "f80e7b96315afffa", "xxh64 100 bytes")
|
||||
end
|
||||
|
||||
-- every case decodes to its corpus
|
||||
local nbytes = 0
|
||||
for _, c in Fx.cases do
|
||||
local want = Fx.corpora[c.corpus]
|
||||
@@ -44,7 +41,6 @@ local function case(name: string): any
|
||||
error("no case " .. name)
|
||||
end
|
||||
|
||||
-- at an offset inside a bigger buffer, and string input
|
||||
do
|
||||
local c = case("text/l3")
|
||||
local big = buffer.create(#c.data + 20)
|
||||
@@ -73,7 +69,6 @@ do
|
||||
t:check(out2 and buffer.tostring(out2) == Fx.corpora.text, "verify = false")
|
||||
end
|
||||
|
||||
-- limits and arguments
|
||||
do
|
||||
local c = case("text/l3")
|
||||
local _, e = Zstd.decompress(c.data, nil, nil, { maxBytes = 1000 })
|
||||
@@ -95,7 +90,6 @@ do
|
||||
t:check(e6 and e6.code == Err.CORRUPT, "reserved block type: " .. tostring(e6))
|
||||
end
|
||||
|
||||
-- truncation, corruption and garbage never throw
|
||||
do
|
||||
local samples = {}
|
||||
for i, c in Fx.cases do
|
||||
|
||||
Reference in new issue
Block a user