tests/codecs (a-m): comments: specs only

This commit is contained in:
4DBug committed 2026-11-01 01:50:19 -05:00
1 parent a80299dce0
commit 5f7f6005f6
24 files changed
+46 -181

No files matched your search

+1 -6
View File
@@ -1,6 +1,4 @@
-- codecs/audio/ApeTag tests: APEv2 tags with and without a header, APEv1, multi-value items, binary items, an ID3v1
-- tag after the APE tag, a tag inside a sub-range, malformed sizes / counts; the fuzz no-throw pass. The real files
-- (wavpack -w, mac -t, ...) are covered by tests/audio/wavpack.luau and tests/audio/ape.luau.
-- codecs/audio/ApeTag tests: hand-made APEv1 / APEv2 tags. The real files are in tests/audio/wavpack.luau and ape.luau.
local T = require("@tests/T")
local ApeTag = require("@rosetta/codecs/audio/ApeTag")
@@ -9,7 +7,6 @@ local t = T.suite("apetag")
local function u32(v: number): string
return string.char(v % 256, (v // 256) % 256, (v // 65536) % 256, (v // 16777216) % 256)
end
-- tag(items, version, header) -> the tag bytes; items = { { key, value, flags? } }
local function tag(items: { any }, version: number, header: boolean): string
local body = {}
for _, it in items do
@@ -41,11 +38,9 @@ do
t:eq(#info.items, 6, "items")
t:eq(info.items[5].kind, "binary", "binary kind")
t:eq(info.items[5].value, "f.png\0PNG", "binary value")
-- ID3v1 after it
local s2 = s .. "TAG" .. string.rep("x", 125)
local tags2, info2 = ApeTag.find(buffer.fromstring(s2), 0, #s2)
t:check(tags2 and tags2.title == "Hello" and info2.stop == #s, "before ID3v1")
-- inside a sub-range
local s3 = "zz" .. s .. "yyy"
local tags3, info3 = ApeTag.find(buffer.fromstring(s3), 2, 2 + #s)
t:check(tags3 and tags3.title == "Hello" and info3.start == 12, "sub-range")