tests/image: comments: specs only

This commit is contained in:
4DBug committed 2026-11-01 01:50:18 -05:00
1 parent e306d5c1d7
commit a80299dce0
27 files changed
+32 -199

No files matched your search

+1 -7
View File
@@ -1,7 +1,4 @@
-- image/pnm tests: ImageMagick-written P1-P7 / PFM files (ASCII and binary, 8 / 16-bit, PAM tuple types, both PFM
-- byte orders) and hand-written edge cases (comments, packed P1 digits, odd maxvals) against ImageMagick's RGBA
-- decodes (8-bit; 16-bit and float natively); round trips of every subtype through our encoder, binary and ASCII;
-- errors; the fuzz no-throw pass. Fixtures: tools/fixtures/pnm.py.
-- image/pnm tests against ImageMagick's decodes (tools/fixtures/pnm.py).
local T = require("@tests/T")
local Pnm = require("@rosetta/image/pnm")
local Bytes = require("@rosetta/core/Bytes")
@@ -18,7 +15,6 @@ local function dec(data: any, opts: any?): (any, any)
return Pnm.decode(Bytes.reader(if type(data) == "string" then buffer.fromstring(data) else data), opts)
end
-- channel c (0..3) of pixel i of a native image, in 16-bit scale
local function chan16(img: any, i: number, c: number): number
local px, f = img.pixels, img.format
if f == "gray16" then
@@ -65,7 +61,6 @@ for _, c in Fx do
end
t:check(fw < 1e-6, c.name .. ": floats")
end
-- round trips through our encoder: the same subtype, binary and ASCII
local ext = string.match(c.name, "%.(%a+)$")
for _, ascii in { false, true } do
local enc, eerr = Pnm.encode(nat, { format = ext, ascii = ascii })
@@ -76,7 +71,6 @@ for _, c in Fx do
end
t:note("%d files match ImageMagick and round-trip", #Fx)
-- encoder choices, conversions, options
do
local img = Types.Image.new(3, 2)
for i = 0, 23 do