aboutsummaryrefslogtreecommitdiff
path: root/tests.lua
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2023-10-01 16:31:30 +0530
committersinanmohd <sinan@sinanmohd.com>2023-10-01 19:59:15 +0530
commitfee405edd055656dd63690e03a0d3e1fc0e96b4e (patch)
tree069ec4d564b2b05f6223a73fc4a696a745a9ffea /tests.lua
parente55ed555257f2ee7ede064c430ffd84cc165b334 (diff)
server: init opensubtitles
Diffstat (limited to 'tests.lua')
-rwxr-xr-xtests.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests.lua b/tests.lua
index 962a8c3..4421b57 100755
--- a/tests.lua
+++ b/tests.lua
@@ -1,6 +1,7 @@
#!/usr/bin/env lua
local subscene = require 'server/subscene'
+local opensubtitles = require 'server/opensubtitles'
local util = require 'lib/util'
local errs = 0
@@ -26,7 +27,20 @@ local test_subscene = function ()
os.remove(out)
end
+local test_opensubtitles = function ()
+ local ohash, id, new_id
+
+ ohash = '395787dbe5b42001'
+ id = '5449593'
+ new_id = opensubtitles.search_ohash(ohash):match('%d*$')
+ if id ~= new_id then
+ util.error('opensubtitles: id mismatch')
+ errs = errs + 1
+ end
+end
+
test_subscene()
+test_opensubtitles()
if errs == 0 then
print('ok: all tests ran successfully')