tests: top-level test comments: specs only
This commit is contained in:
1 parent
0bd7b87d2b
commit
e0ab895027
3 files changed
+4
-38
No files matched your search
+1
-7
@@ -1,6 +1,4 @@
|
||||
-- API tests (src/Rosetta/init.luau): load / save / saveString / convert / open / detect / formats / format, the
|
||||
-- category facades, sniff-then-extension detection, errors as Err values (never a throw), and file paths on hosts with
|
||||
-- a file system (LuaJIT: a temporary file; the luau CLI has none).
|
||||
-- API tests: load / save / convert / open / detect, the category facades, errors as values, file paths.
|
||||
local T = require("@tests/T")
|
||||
local F = require("@rosetta")
|
||||
local Err = require("@rosetta/core/Err")
|
||||
@@ -15,10 +13,8 @@ local function image(w: number, h: number): any
|
||||
return img
|
||||
end
|
||||
|
||||
-- host
|
||||
t:eq(F.host.name, if T.runtime == "luajit" then "luajit" else "luau", "host detected")
|
||||
|
||||
-- formats()
|
||||
do
|
||||
local all = F.formats()
|
||||
t:check(#all >= 1, "formats() lists the registry")
|
||||
@@ -57,7 +53,6 @@ do
|
||||
t:eq(F.detect(buf), "png", "detect")
|
||||
local conv = F.convert(s, "png", { level = 1 })
|
||||
t:check(conv and F.load(conv).width == 7, "convert")
|
||||
-- format options reach the encoder
|
||||
local stored = F.save(img, nil, { format = "png", level = 0 }) :: buffer
|
||||
t:check(buffer.len(stored) > buffer.len(buf :: buffer), "opts.level reaches the encoder")
|
||||
end
|
||||
@@ -116,7 +111,6 @@ else
|
||||
t:check(e2 and e2.code == Err.IO, "no file system: load of a path is Err.IO")
|
||||
end
|
||||
|
||||
-- Types constructors
|
||||
do
|
||||
local T2 = F.Types
|
||||
t:eq(buffer.len(T2.Image.new(3, 2, "rgb8").pixels), 18, "Image.new rgb8")
|
||||
|
||||
Reference in new issue
Block a user