blob: 76417d3542e9f7ce22d5e200277a5ac62c2168f1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/usr/bin/env lua
local subscene = require 'server/subscene'
local util = require 'lib/util'
local errs = 0
local test_subscene = function ()
local out, ohash, name, rc
out = os.tmpname()
name = util.string_rm_vid_ext('Fight Club (1999) (1080p BluRay x265 10bit Tigole) [QxR].mp4')
ohash = 'ffec132e13e08f4c'
rc = subscene.search(name, out)
if not rc then
util.error('subscene: fetch failed')
errs = errs + 1
end
if rc and ohash ~= util.opensubtitles_hash(out) then
util.error('subscene: hash mismatch')
errs = errs + 1
end
os.remove(out)
end
test_subscene()
if errs == 0 then
print('ok: all tests ran successfully')
else
os.exit(false)
end
|