diff options
Diffstat (limited to 'tests.lua')
-rwxr-xr-x | tests.lua | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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') |