tests/playlist, tests/subtitle: comments: specs only
This commit is contained in:
1 parent
e0ab895027
commit
928ac9b39f
6 files changed
+10
-44
No files matched your search
@@ -1,6 +1,4 @@
|
||||
-- subtitle/srt tests: a random SRT script against ffmpeg (its own parse via its srt muxer: times to the millisecond,
|
||||
-- text), ffmpeg's conversions of WebVTT / ASS / SSA files to SRT, odd layouts (no index, blank lines in text, CRLF,
|
||||
-- BOM, dot decimals, coordinates), round trips through the encoder, the contract and the fuzz pass.
|
||||
-- subtitle/srt tests: a random SRT script and ffmpeg's WebVTT / ASS / SSA conversions against ffmpeg.
|
||||
-- Fixtures: tools/fixtures/subtitles.py.
|
||||
local T = require("@tests/T")
|
||||
local Srt = require("@rosetta/subtitle/srt")
|
||||
@@ -35,7 +33,6 @@ t:eq(Srt.name, "srt", "name")
|
||||
t:eq(Srt.category, "subtitle", "category")
|
||||
t:check(Srt.caps.decode and Srt.caps.encode, "caps")
|
||||
|
||||
-- the random script and ffmpeg's re-mux of it
|
||||
local subs, err = decode(Fx.srt)
|
||||
t:check(subs, "decode: " .. tostring(err))
|
||||
same(subs, Fx.cues, "random")
|
||||
@@ -48,7 +45,6 @@ for _, h in Fx.hand do
|
||||
same(decode(h.ffmpeg_srt), h.cues, "ffmpeg " .. h.name .. " -> srt")
|
||||
end
|
||||
|
||||
-- odd layouts
|
||||
do
|
||||
local s = "\239\187\1911\r\n00:00:01.5 --> 00:00:02,25 X1:10 X2:20 Y1:5 Y2:6\r\nfirst\r\n\r\nsecond paragraph\r\n\r\n\r\n00:00:03,000 --> 00:00:04,000\r\nno index\r\n2\r\n00:00:05,000-->00:00:06,000\r\n"
|
||||
local r = decode(s)
|
||||
@@ -66,7 +62,6 @@ do
|
||||
t:eq(again.cues[1].settings, r.cues[1].settings, "odd: round trip keeps the coordinates")
|
||||
end
|
||||
|
||||
-- round trips (LF and CRLF)
|
||||
for _, crlf in { false, true } do
|
||||
local out = Srt.encode(subs, { crlf = crlf }) :: buffer
|
||||
local back = Srt.decode(Bytes.reader(out))
|
||||
@@ -82,7 +77,6 @@ for _, crlf in { false, true } do
|
||||
end
|
||||
end
|
||||
|
||||
-- errors
|
||||
do
|
||||
local _, e = decode("just some text\nno timings")
|
||||
t:check(e and e.code == Err.CORRUPT, "no cues: " .. tostring(e))
|
||||
|
||||
Reference in new issue
Block a user